IAudioFrameObserverBase
Audio frame observer.
You can call registerAudioFrameObserver to register or unregister the IAudioFrameObserverBase audio observer.
onEarMonitoringAudioFrame
Receives the raw audio data for ear monitoring.
onEarMonitoringAudioFrame?(audioFrame: AudioFrame): void;
To ensure the ear monitoring audio data format meets expectations, you can set it as follows: Call setEarMonitoringAudioFrameParameters to set the audio format, then call registerAudioFrameObserver to register the audio frame observer. The SDK calculates the sampling interval based on the parameters in this method and triggers the onEarMonitoringAudioFrame callback accordingly.
Parameters
- audioFrame
- The raw audio data. See AudioFrame.
onMixedAudioFrame
Retrieves the audio data after mixing the captured and playback audio.
onMixedAudioFrame?(channelId: string, audioFrame: AudioFrame): void;
To ensure that the format of the mixed audio data from capture and playback meets expectations, you can set the audio data format using the following method: After calling setMixedAudioFrameParameters to set the audio data format, call registerAudioFrameObserver to register the audio observer object. The SDK calculates the sampling interval based on the parameters in this method and triggers the onMixedAudioFrame callback accordingly.
Parameters
- audioFrame
- Raw audio data. See AudioFrame.
- channelId
- Channel ID.
onPlaybackAudioFrame
Receives the raw audio data for playback.
onPlaybackAudioFrame?(channelId: string, audioFrame: AudioFrame): void;
To ensure the playback audio data format meets expectations, you can set the format as follows: Call setPlaybackAudioFrameParameters to set the audio format, then call registerAudioFrameObserver to register the audio frame observer. The SDK calculates the sampling interval based on the parameters in 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 for recording.
onRecordAudioFrame?(channelId: string, audioFrame: AudioFrame): void;
To ensure the recorded audio data format meets expectations, you can set the format as follows: Call setRecordingAudioFrameParameters to set the audio format, then call registerAudioFrameObserver to register the audio frame observer. The SDK calculates the sampling interval based on the parameters in this method and triggers the onRecordAudioFrame callback accordingly.
Parameters
- audioFrame
- The raw audio data. See AudioFrame.
- channelId
- The channel ID.