public interface Music
loadMusic()
functions. Music can be
played, paused, resumed, stopped and looped from specified positions.Modifier and Type | Method and Description |
---|---|
boolean |
done()
Determine if this Music has reached its end and is done playing.
|
int |
getLoopPositionByFrame()
Get the loop position of this Music by sample frame.
|
double |
getLoopPositionBySeconds()
Get the loop position of this Music by seconds.
|
double |
getPan()
Get the pan of this Music.
|
double |
getVolume()
Get the volume of this Music.
|
boolean |
loop()
Determine if this Music will loop.
|
void |
pause()
Stop playing this Music and keep its current position.
|
void |
play(boolean loop)
Play this Music and loop if specified.
|
void |
play(boolean loop,
double volume)
Play this Music at the specified volume and loop if specified.
|
void |
play(boolean loop,
double volume,
double pan)
Play this Music at the specified volume and pan, and loop if specified.
|
boolean |
playing()
Determine if this Music is playing.
|
void |
resume()
Play this Music from its current position.
|
void |
rewind()
Set this Music's position to the beginning.
|
void |
rewindToLoopPosition()
Set this Music's position to the loop position.
|
void |
setLoop(boolean loop)
Set whether this Music will loop.
|
void |
setLoopPositionByFrame(int frameIndex)
Set the loop position of this Music by sample frame.
|
void |
setLoopPositionBySeconds(double seconds)
Set the loop position of this Music by seconds.
|
void |
setPan(double pan)
Set the pan of this Music.
|
void |
setVolume(double volume)
Set the volume of this Music.
|
void |
stop()
Stop playing this Music and set its position to the beginning.
|
void |
unload()
Unload this Music from the system.
|
void play(boolean loop)
loop
- if this Music should loopvoid play(boolean loop, double volume)
loop
- if this Music should loopvolume
- the volume to play the this Musicvoid play(boolean loop, double volume, double pan)
loop
- if this Music should loopvolume
- the volume to play the this Musicpan
- the pan at which to play this Music [-1.0,1.0], values outside
the valid range will be ignoredvoid stop()
void pause()
void resume()
void rewind()
void rewindToLoopPosition()
boolean playing()
boolean done()
boolean loop()
void setLoop(boolean loop)
loop
- whether this Music will loopint getLoopPositionByFrame()
double getLoopPositionBySeconds()
void setLoopPositionByFrame(int frameIndex)
frameIndex
- sample frame loop position to setvoid setLoopPositionBySeconds(double seconds)
seconds
- loop position to set by secondsdouble getVolume()
void setVolume(double volume)
volume
- the desired volume of this Musicdouble getPan()
void setPan(double pan)
pan
- the desired pan of this Musicvoid unload()