IAudioFrameObserverBase

Audio observer.

You can call registerAudioFrameObserver to register or unregister the IAudioFrameObserverBase audio observer.

onEarMonitoringAudioFrame

Receives the raw audio data of the ear monitoring.

onEarMonitoringAudioFrame?(audioFrame: AudioFrame): void;

To ensure the ear monitoring audio data format meets expectations, you can configure it using the following methods: Call setEarMonitoringAudioFrameParameters to set the audio format, and then call registerAudioFrameObserver to register the audio frame observer. The SDK calculates the sampling interval based on the parameters of this method and triggers the onEarMonitoringAudioFrame callback accordingly.

Parameters

audioFrame
The raw audio data. See AudioFrame.

onMixedAudioFrame

Retrieves the data after audio mixing of capture and playback.

onMixedAudioFrame?(channelId: string, audioFrame: AudioFrame): void;

To ensure that the audio data format after capture and playback mixing meets expectations, you can set the audio data format using the following methods: call setMixedAudioFrameParameters to set the audio data format, then call registerAudioFrameObserver to register the audio observer object. The SDK will calculate the sampling interval based on the parameters in this method and trigger the onMixedAudioFrame callback accordingly.

Parameters

audioFrame
Raw audio data. See AudioFrame.
channelId
Channel ID.

onPlaybackAudioFrame

Receives the raw audio data of the playback.

onPlaybackAudioFrame?(channelId: string, audioFrame: AudioFrame): void;

To ensure the playback audio data format meets expectations, you can configure it using the following methods: Call setPlaybackAudioFrameParameters to set the audio format, and then call registerAudioFrameObserver to register the audio frame observer. The SDK calculates the sampling interval based on the parameters of this method and triggers the onPlaybackAudioFrame callback accordingly.

Parameters

audioFrame
The raw audio data. See AudioFrame.
channelId
The channel ID.

onRecordAudioFrame

Receives the raw audio data of the recording.

onRecordAudioFrame?(channelId: string, audioFrame: AudioFrame): void;

To ensure the recorded audio data format meets expectations, you can configure it using the following methods: Call setRecordingAudioFrameParameters to set the audio format, and then call registerAudioFrameObserver to register the audio frame observer. The SDK calculates the sampling interval based on the parameters of this method and triggers the onRecordAudioFrame callback accordingly.

Parameters

audioFrame
The raw audio data. See AudioFrame.
channelId
The channel ID.