public interface AudioDevice extends Disposable
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.Modifier and Type | Method and Description |
---|---|
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.
|
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)
Copyright © 2014. All Rights Reserved.