Package arc.audio
Class Music
java.lang.Object
arc.audio.AudioSource
arc.audio.Music
- All Implemented Interfaces:
Disposable
A Music instance represents a streamed audio file. The interface supports pausing, resuming
and so on. When you are done with using the Music instance you have to dispose it via the AudioSource.dispose()
method.
Music instances are created via Audio.newMusic(Fi)
.
Music instances are automatically paused and resumed when an Application
is paused or resumed. See
ApplicationListener
.
Note: any values provided will not be clamped, it is the developer's responsibility to do so
-
Field Summary
Fields inherited from class arc.audio.AudioSource
handle
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static Fi[]
float
float
boolean
boolean
void
void
pause
(boolean pause) void
play()
void
set
(float pan, float volume) void
setLooping
(boolean isLooping) void
setPosition
(float position) void
setVolume
(float volume) void
stop()
toString()
Methods inherited from class arc.audio.AudioSource
dispose, setFilter, setFilter
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface arc.util.Disposable
isDisposed
-
Constructor Details
-
Music
Loads music from a file.- Throws:
Exception
-
Music
public Music()Creates an empty music instance. This instance cannot be played until loaded.
-
-
Method Details
-
load
- Throws:
Exception
-
play
public void play() -
pause
public void pause(boolean pause) -
stop
public void stop() -
isPlaying
public boolean isPlaying() -
isLooping
public boolean isLooping() -
setLooping
public void setLooping(boolean isLooping) -
getVolume
public float getVolume() -
setVolume
public void setVolume(float volume) -
set
public void set(float pan, float volume) -
getPosition
public float getPosition() -
setPosition
public void setPosition(float position) -
toString
-
caches
- Throws:
IOException
-