IAudioFrameObserverBase
The audio frame observer.
You can call registerAudioFrameObserver to register or unregister the IAudioFrameObserverBase audio frame observer.
onMixedAudioFrame
Retrieves the mixed captured and playback audio frame.
onMixedAudioFrame?(channelId: string, audioFrame: AudioFrame): boolean;
To ensure that the data format of mixed captured and playback audio frame meets the expectations, Agora recommends that you set the data format as follows: After calling setMixedAudioFrameParameters to set the audio data format and registerAudioFrameObserver to register the audio frame observer object, the SDK calculates the sampling interval according to the parameters set in the methods, and triggers the onMixedAudioFrame callback according to the sampling interval.
Parameters
- audioFrame
- The raw audio data. See AudioFrame.
- channelId
- The channel ID.
Returns
Without practical meaning.
onPlaybackAudioFrame
Gets the raw audio frame for playback.
onPlaybackAudioFrame?(channelId: string, audioFrame: AudioFrame): boolean;
To ensure that the data format of audio frame for playback is as expected, Agora recommends that you set the audio data format as follows: After calling setPlaybackAudioFrameParameters to set the audio data format and registerAudioFrameObserver to register the audio frame observer object, the SDK calculates the sampling interval according to the parameters set in the methods, and triggers the onPlaybackAudioFrame callback according to the sampling interval.
Parameters
- audioFrame
- The raw audio data. See AudioFrame.
- channelId
- The channel ID.
Returns
Without practical meaning.
onRecordAudioFrame
Gets the captured audio frame.
onRecordAudioFrame?(channelId: string, audioFrame: AudioFrame): boolean;
To ensure that the data format of captured audio frame is as expected, Agora recommends that you set the audio data format as follows: After calling setRecordingAudioFrameParameters to set the audio data format, call registerAudioFrameObserver to register the audio observer object, the SDK will calculate the sampling interval according to the parameters set in this method, and triggers the onRecordAudioFrame callback according to the sampling interval.
Parameters
- audioFrame
- The raw audio data. See AudioFrame.
- channelId
- The channel ID.
Returns
Without practical meaning.