registerAudioFrameObserver abstract method

void registerAudioFrameObserver(
  1. AudioFrameObserver observer
)

Registers an audio observer object.

This method registers an audio observer object, i.e., registers callbacks. When you need the SDK to trigger onMixedAudioFrame, onRecordAudioFrame, onPlaybackAudioFrame, onPlaybackAudioFrameBeforeMixing, and onEarMonitoringAudioFrame callbacks, you need to call this method to register the callbacks.

  • observer Instance of the interface object. See AudioFrameObserver. It is recommended to call this after receiving onLeaveChannel to release the audio observer object.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.

Implementation

void registerAudioFrameObserver(AudioFrameObserver observer);