# RemoteAudioFrameListener

fun interface RemoteAudioFrameListener

Listener for remote audio playout events.

Callbacks allow observing and modifying the decoded PCM audio received from the remote party before it is written to the audio output device.

Register via AudioController.setRemoteAudioFrameListener.

Threading: all callbacks are delivered on the same dedicated high-priority audio thread (`THREAD_PRIORITY_URGENT_AUDIO`), in the order onAudioPlayoutStarted, onAudioFrame, onAudioPlayoutStopped. Implementations must not block — any significant delay will cause audio glitches or jitter on the local end.

## Functions

onAudioFrame
Link copied to clipboard
abstract fun onAudioFrame(track: AudioPlayoutInfo, bytesAvailable: Int, byteBuffer: ByteBuffer): Boolean

Called for every 10 ms audio buffer received from the remote party, before it is written to the audio output device.

onAudioPlayoutStarted
Link copied to clipboard
open fun onAudioPlayoutStarted(track: AudioPlayoutInfo)

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

onAudioPlayoutStopped
Link copied to clipboard
open fun onAudioPlayoutStopped(track: AudioPlayoutInfo)

Called when remote audio playout has stopped, after the final onAudioFrame call; no further buffers will be delivered for this session. Audio already handed to the output device may continue to play out briefly after this call.