AudioFrameObserverBase

The audio frame observer.

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

onEarMonitoringAudioFrame

Gets the in-ear monitoring audio frame.

final void Function(AudioFrame audioFrame)? onEarMonitoringAudioFrame;

In order to ensure that the obtained in-ear audio data meets the expectations, Agora recommends that you set the in-ear monitoring-ear audio data format as follows: After calling setEarMonitoringAudioFrameParameters 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 onEarMonitoringAudioFrame callback according to the sampling interval.

Note:
  • Due to the limitations of Flutter, this callback does not support sending processed audio data back to the SDK.

Parameters

audioFrame
The raw audio data. See AudioFrame.

onMixedAudioFrame

Retrieves the mixed captured and playback audio frame.

final void Function(String channelId, AudioFrame audioFrame)?
      onMixedAudioFrame;

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.

Note:
  • Due to the limitations of Flutter, this callback does not support sending processed audio data back to the SDK.

Parameters

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

onPlaybackAudioFrame

Gets the raw audio frame for playback.

final void Function(String channelId, AudioFrame audioFrame)?
      onPlaybackAudioFrame;

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.

Note:
  • Due to the limitations of Flutter, this callback does not support sending processed audio data back to the SDK.

Parameters

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

onPlaybackAudioFrameBeforeMixing

Retrieves the audio frame of a specified user before mixing.

final void Function(String channelId, int uid, AudioFrame audioFrame)?
      onPlaybackAudioFrameBeforeMixing;
Attention: Due to the limitations of Flutter, this callback does not support sending processed audio data back to the SDK.

Parameters

channelId
The channel ID.
uid
The user ID of the specified user.
audioFrame
The raw audio data. See AudioFrame.

onRecordAudioFrame

Gets the captured audio frame.

final void Function(String channelId, AudioFrame audioFrame)?
      onRecordAudioFrame;

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.

Note:
  • Due to the limitations of Flutter, this callback does not support sending processed audio data back to the SDK.

Parameters

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