public class SoundClip extends Object
Modifier and Type | Field and Description |
---|---|
WaveFormat |
format
The format for this SoundClip.
|
int |
leftVolumePercent |
int |
rightVolumePercent |
Constructor and Description |
---|
SoundClip(FormattedDataSource source) |
SoundClip(String clipName) |
SoundClip(WaveFormat format,
byte[] rawWaveData,
int offset,
int length) |
SoundClip(WaveFormat format,
InputStream rawBytes) |
Modifier and Type | Method and Description |
---|---|
long |
countFrames()
Return the number of frames in the SoundClip.
|
protected void |
finalize()
This method (when overriden), will be called when the VM determines that the Object can be
garbage collected.
|
void |
free() |
static Hashtable |
getOpenWaveOutputs()
This is a Hashtable of WaveOutput objects used for playing
clips via the play() and play(boolean loop) method.
|
InputStream |
getRawBytes() |
WaveOutput |
getWaveOutput()
Return the WaveOutput being used or will be used by this SoundClip.
|
static WaveOutput |
getWaveOutputFor(WaveFormat format)
Get the WaveOutput used by the SoundClip class for
output of a particular wave format.
|
Handle |
play() |
Handle |
play(boolean immediately,
boolean loop) |
Handle |
play(WaveOutput output,
boolean immediate,
boolean loop) |
void |
readIntoMemory()
This automatically makes the SoundClip loopable.
|
WaveOutput |
reserveExclusiveOutput()
Create, save and return a new WaveOutput for use by this SoundClip only.
|
void |
reserveSharedOutput()
Make sure a WaveOutput for this format (to be shared by other SoundClips)
is reserved and ready for use.
|
long |
resetToFrame(long frame) |
void |
resetToStart() |
void |
setWaveOutput(WaveOutput output)
Set the WaveOutput for use by this SoundClip only.
|
public WaveFormat format
public int leftVolumePercent
public int rightVolumePercent
public SoundClip(String clipName) throws IOException
IOException
public SoundClip(FormattedDataSource source) throws IOException
IOException
public SoundClip(WaveFormat format, InputStream rawBytes) throws IOException
IOException
public SoundClip(WaveFormat format, byte[] rawWaveData, int offset, int length)
public void readIntoMemory() throws IOException
IOException
- if there was an IO error reading the bytes.public long countFrames() throws IOException
IOException
public static Hashtable getOpenWaveOutputs()
public WaveOutput getWaveOutput() throws IOException
IOException
public InputStream getRawBytes()
public long resetToFrame(long frame) throws IOException
IOException
public void resetToStart() throws IOException
IOException
public Handle play(WaveOutput output, boolean immediate, boolean loop)
public Handle play()
public Handle play(boolean immediately, boolean loop)
public static WaveOutput getWaveOutputFor(WaveFormat format) throws IOException
format
- the format for output.IOException
- if no WaveOutput could be created for
the format.public void reserveSharedOutput() throws IOException
IOException
- if a shared one was not available and a new shared
one could not be created.public WaveOutput reserveExclusiveOutput() throws IOException
IOException
- if one could not be created.public void setWaveOutput(WaveOutput output)
output
- the WaveOutput for exclusive use by this SoundClippublic void free()
protected void finalize()
Object
The finalize() method of a Class is only called if it overrides finalize() - the finalize() method java.lang.Object is never called by the Eve VM.