# LocalAudioFrameListener

fun interface 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

onAudioFrame
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.

onAudioRecordingStarted
Link copied to clipboard
open fun onAudioRecordingStarted(record: AudioRecordInfo)

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

onAudioRecordingStopped
Link copied to clipboard
open fun onAudioRecordingStopped(record: AudioRecordInfo)

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