|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Music
A Music instance represents a streamed audio file. The interface supports setting the play back position, pausing and resuming
and so on. When you are done with using the Music instance you have to dispose it via the dispose()
method.
Music instances are created via Audio.newMusic(FileHandle)
.
Music instances are automatically paused and resumed when an Application
is paused or resumed. See
ApplicationListener
.
Method Summary | |
---|---|
void |
dispose()
Needs to be called when the Music is no longer needed. |
float |
getPosition()
Returns the playback position in milliseconds. |
boolean |
isLooping()
|
boolean |
isPlaying()
|
void |
pause()
Pauses the play back. |
void |
play()
Starts the play back of the music stream. |
void |
setLooping(boolean isLooping)
Sets whether the music stream is looping. |
void |
setVolume(float volume)
Sets the volume of this music stream. |
void |
stop()
Stops a playing or paused Music instance. |
Method Detail |
---|
void play()
void pause()
void stop()
boolean isPlaying()
void setLooping(boolean isLooping)
isLooping
- whether to loop the streamboolean isLooping()
void setVolume(float volume)
volume
- float getPosition()
void dispose()
dispose
in interface Disposable
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |