|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The AudioDevice interface provides an abstraction for
a device capable of sounding audio samples. Samples are written to
the device via the write() method. The device assumes
that these samples are signed 16-bit samples taken at the output frequency
of the decoder. If the decoder outputs more than one channel, the samples for
each channel are assumed to appear consecutively, with the lower numbered
channels preceeding higher-numbered channels. E.g. if there are two
channels, the samples will appear in this order:
l0, r0, l1, r1, l2, r2...
where
lx indicates the xth sample on channel 0
rx indicates the xth sample on channel 1
| Method Summary | |
void |
close()
Closes this audio device. |
void |
endOfFile()
Is called if the end of file has been reached. |
void |
flush()
Blocks until all audio samples previously written to this audio device have been heard. |
boolean |
isEightBitEightKhzMuLaw()
Returns true, if the audio device is a crappy eight-bit eight khz ulaw decoder (browser). |
void |
open(mediaframe.mpeg1.audio.decoder.Decoder decoder)
Prepares the AudioDevice for playback of audio samples. |
void |
pause()
Pause the Player. |
void |
play()
Start player playing. |
void |
setMute(boolean mute)
Set the mute state of the audio playback. |
void |
setVolume(float volume)
Sets the volume (in the range 0..1) of the audio playback. |
void |
stop()
Stop player playing. |
void |
write(short[] samples,
int offs,
int len)
Writes audio data to this audio device. |
| Method Detail |
public void open(mediaframe.mpeg1.audio.decoder.Decoder decoder)
throws mediaframe.mpeg1.audio.decoder.JavaLayerException
decoder - the decoder that will be providing the audio
samples.
mediaframe.mpeg1.audio.decoder.JavaLayerException
public void write(short[] samples,
int offs,
int len)
throws mediaframe.mpeg1.audio.decoder.JavaLayerException
samples - the array of signed 16-bit samples to write
to the audio device.offs - the offset of the first sample.len - the number of samples to write.
mediaframe.mpeg1.audio.decoder.JavaLayerExceptionpublic void close()
write or flush
operation should be unblocked by this method.
public void flush()
public void play()
public void stop()
public boolean isEightBitEightKhzMuLaw()
public void setVolume(float volume)
volume - the volume to set.public void setMute(boolean mute)
mute - the mute state (true if the mute on and the player doesn't play the audio).public void pause()
public void endOfFile()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||