public interface AudioSampleCallback
Modifier and Type | Method and Description |
---|---|
void |
onAudioData(byte[] audioData,
int offsetInBytes,
int sizeInBytes)
Called when a piece of audio data is ready.
|
void |
onAudioFormat(int audioFormat,
int channelMask,
int sampleRate)
Called when the audio sample format has changed.
|
void onAudioData(byte[] audioData, int offsetInBytes, int sizeInBytes)
audioData
- The audio data that can be played via android.media.AudioTrack
.offsetInBytes
- The offset expressed in bytes in audioData where the data to write starts.sizeInBytes
- The number of bytes to write in audioData after the offset.void onAudioFormat(int audioFormat, int channelMask, int sampleRate)
AudioFormat
.audioFormat
- The audio data encoding format. See AudioFormat.Builder#setEncoding(int)
channelMask
- The channel position mask. See AudioFormat.Builder#setChannelMask(int)
sampleRate
- The sample rate expressed in Hz. See AudioFormat.Builder#setSampleRate(int)