AudioFrameObserverBase
Audio observer.
You can call registerAudioFrameObserver to register or unregister the AudioFrameObserverBase.
onEarMonitoringAudioFrame
Receives the raw audio data for ear monitoring.
final void Function(AudioFrame audioFrame)? onEarMonitoringAudioFrame;
To ensure the audio data format for ear monitoring meets expectations, you can set the format using the following methods: Call setEarMonitoringAudioFrameParameters to set the audio data format, then call registerAudioFrameObserver to register the audio observer object. The SDK calculates the sampling interval based on the parameters in this method and triggers the onEarMonitoringAudioFrame callback accordingly.
- Due to framework limitations, this callback does not support sending the processed audio data back to the SDK.
Parameters
- audioFrame
- The raw audio data. See AudioFrame.
onMixedAudioFrame
Retrieves the data after mixing recorded and playback audio.
final void Function(String channelId, AudioFrame audioFrame)?
onMixedAudioFrame;
To ensure the format of the mixed audio data from recording and playback 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 frame observer object. The SDK calculates the sampling interval based on the parameters of this method and triggers the onMixedAudioFrame callback accordingly.
- Due to framework limitations, this callback does not support sending the processed audio data back to the SDK.
Parameters
- audioFrame
- Raw audio data. See AudioFrame.
- channelId
- Channel ID.
onPlaybackAudioFrame
Retrieves the raw audio data being played.
final void Function(String channelId, AudioFrame audioFrame)?
onPlaybackAudioFrame;
To ensure the format of the playback audio data meets expectations, you can set the audio data format using the following methods: Call setPlaybackAudioFrameParameters to set the audio data format, then call registerAudioFrameObserver to register the audio frame observer object. The SDK calculates the sampling interval based on the parameters of this method and triggers the onPlaybackAudioFrame callback accordingly.
- Due to framework limitations, this callback does not support sending the processed audio data back to the SDK.
Parameters
- audioFrame
- Raw audio data. See AudioFrame.
- channelId
- Channel ID.
onRecordAudioFrame
Retrieves the raw audio data collected.
final void Function(String channelId, AudioFrame audioFrame)?
onRecordAudioFrame;
To ensure the format of the recorded audio data meets expectations, you can set the audio data format using the following methods: Call setRecordingAudioFrameParameters to set the audio data format, then call registerAudioFrameObserver to register the audio frame observer object. The SDK calculates the sampling interval based on the parameters of this method and triggers the onRecordAudioFrame callback accordingly.
- Due to framework limitations, this callback does not support sending the processed audio data back to the SDK.
Parameters
- audioFrame
- Raw audio data. See AudioFrame.
- channelId
- Channel ID.