onAudioBuffer
abstract fun onAudioBuffer(pcm: ByteBuffer, presentationTimeUs: Long, sampleRate: Int?, channelCount: Int?, encoding: Int?)
Observes decoded PCM before it is queued for audio playback.
Parameters
pcm
Read-only, native-byte-order view containing only the valid buffer range. Its initial position is zero and its capacity is the valid byte count. Consume synchronously; do not retain it. Changing its position does not change the decoder's buffer position.
presentationTimeUs
Presentation timestamp in microseconds.
sampleRate
Actual output sample rate in Hz, or null when unavailable.
channelCount
Actual interleaved channel count, or null when unavailable.
encoding
Android AudioFormat PCM encoding, or null when unavailable.