Skip to main content
Register the local PCM callback with RTCEngine.setRtcLocalAudioFrameEvent(...); pass null to unbind. The callback belongs to the Engine’s shared capture layer and carries no channel ID; in multi-channel scenarios, each physically captured frame is delivered only once, and the SDK’s own publishing doesn’t depend on this listener.

onLocalAudioFrame(pcm, sampleRate, channelCount, audioFormat)

:::warning Registering the listener doesn’t open the microphone by itself. You must call LocalMicTrack.startCapture(...); PCM callbacks start only after it succeeds, and stop after you call stopCapture(). Callbacks run serially on the SDK’s audio dispatch thread and aren’t guaranteed to be on the main thread. The PCM is a separate copy for the app, so modifying it doesn’t affect the SDK’s uplink, and time-consuming processing doesn’t block the uplink either; however, when the side queue stays full, older app callback frames are dropped first. For recording or writing to disk, still hand frames off quickly to your app’s own work queue. :::