LocalAudioFrameListener

Listener for local audio recording events.

Callbacks allow observing and modifying the raw PCM audio captured from the microphone before it is passed to the WebRTC engine for encoding and transmission.

Register via AudioController.setLocalAudioFrameListener.

Threading: all callbacks are delivered on the same dedicated high-priority audio thread (THREAD_PRIORITY_URGENT_AUDIO), in the order onAudioRecordingStarted, onAudioFrame, onAudioRecordingStopped. Implementations must not block — any significant delay will cause audio glitches.

Functions

Link copied to clipboard
abstract fun onAudioFrame(record: AudioRecordInfo, bytesRead: Int, byteBuffer: ByteBuffer): Boolean

Called for every 10 ms audio buffer captured from the microphone, before it is handed to the WebRTC engine.

Link copied to clipboard

Called when audio recording has started, before the first onAudioFrame call.

Link copied to clipboard

Called when audio recording has stopped, after the final onAudioFrame call.