|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AudioDevice
Encapsulates an audio device in 44.1khz mono or stereo mode. Use the writeSamples(float[], int, int)
and
writeSamples(short[], int, int)
methods to write float or 16-bit signed short PCM data directly to the audio device.
Stereo samples are interleaved in the order left channel sample, right channel sample. The dispose()
method must be
called when this AudioDevice is no longer needed.
Method Summary | |
---|---|
void |
dispose()
Frees all resources associated with this AudioDevice. |
int |
getLatency()
|
boolean |
isMono()
|
void |
setVolume(float volume)
Sets the volume in the range [0,1]. |
void |
writeSamples(float[] samples,
int offset,
int numSamples)
Writes the array of float PCM samples to the audio device and blocks until they have been processed. |
void |
writeSamples(short[] samples,
int offset,
int numSamples)
Writes the array of 16-bit signed PCM samples to the audio device and blocks until they have been processed. |
Method Detail |
---|
boolean isMono()
void writeSamples(short[] samples, int offset, int numSamples)
samples
- The samples.offset
- The offset into the samples arraynumSamples
- the number of samples to write to the devicevoid writeSamples(float[] samples, int offset, int numSamples)
samples
- The samples.offset
- The offset into the samples arraynumSamples
- the number of samples to write to the deviceint getLatency()
void dispose()
dispose
in interface Disposable
void setVolume(float volume)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |