Constructor and Description |
---|
StreamMusic(URL dataURL,
long numBytesPerChannel,
Mixer mixer)
Construct a new StreamMusic with the given data and the Mixer with which
to register this StreamMusic.
|
Modifier and Type | Method and Description |
---|---|
boolean |
done()
Determine if this StreamMusic has reached its end and is done playing.
|
int |
getLoopPositionByFrame()
Get the loop position of this StreamMusic by sample frame.
|
double |
getLoopPositionBySeconds()
Get the loop position of this StreamMusic by seconds.
|
double |
getPan()
Get the pan of this StreamMusic.
|
double |
getVolume()
Get the volume of this StreamMusic.
|
boolean |
loop()
Determine if this StreamMusic will loop.
|
void |
pause()
Stop playing this StreamMusic and keep its current position.
|
void |
play(boolean loop)
Play this StreamMusic and loop if specified.
|
void |
play(boolean loop,
double volume)
Play this StreamMusic at the specified volume and loop if specified.
|
void |
play(boolean loop,
double volume,
double pan)
Play this StreamMusic at the specified volume and pan, and loop if
specified.
|
boolean |
playing()
Determine if this StreamMusic is playing.
|
void |
resume()
Play this StreamMusic from its current position.
|
void |
rewind()
Set this StreamMusic's position to the beginning.
|
void |
rewindToLoopPosition()
Set this StreamMusic's position to the loop position.
|
void |
setLoop(boolean loop)
Set whether this StreamMusic will loop.
|
void |
setLoopPositionByFrame(int frameIndex)
Set the loop position of this StreamMusic by sample frame.
|
void |
setLoopPositionBySeconds(double seconds)
Set the loop position of this StreamMusic by seconds.
|
void |
setPan(double pan)
Set the pan of this StreamMusic.
|
void |
setVolume(double volume)
Set the volume of this StreamMusic.
|
void |
stop()
Stop playing this StreamMusic and set its position to the beginning.
|
void |
unload()
Unload this MemMusic from the system.
|
public StreamMusic(URL dataURL, long numBytesPerChannel, Mixer mixer) throws IOException
dataURL
- URL of the temporary file containing audio datanumBytesPerChannel
- the total number of bytes for each channel in
the filemixer
- Mixer that will handle this StreamSoundIOException
- if a stream cannot be opened from the URLpublic void play(boolean loop)
public void play(boolean loop, double volume)
public void play(boolean loop, double volume, double pan)
public void stop()
public void pause()
public void resume()
public void rewind()
public void rewindToLoopPosition()
rewindToLoopPosition
in interface Music
public boolean playing()
public boolean done()
public boolean loop()
public void setLoop(boolean loop)
public int getLoopPositionByFrame()
getLoopPositionByFrame
in interface Music
public double getLoopPositionBySeconds()
getLoopPositionBySeconds
in interface Music
public void setLoopPositionByFrame(int frameIndex)
setLoopPositionByFrame
in interface Music
frameIndex
- sample frame loop position to setpublic void setLoopPositionBySeconds(double seconds)
setLoopPositionBySeconds
in interface Music
seconds
- loop position to set by secondspublic double getVolume()
public void setVolume(double volume)
public double getPan()
public void setPan(double pan)