IAudioFrameObserver

The audio frame observer.

You can call RegisterAudioFrameObserver to register or unregister the IAudioFrameObserver audio frame observer.

OnEarMonitoringAudioFrame

Gets the in-ear monitoring audio frame.

public virtual bool OnEarMonitoringAudioFrame(AudioFrame audioFrame)
        {
            return true;
        }

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.

Parameters

audioFrame
The raw audio data. See AudioFrame.

Returns

Without practical meaning.

OnMixedAudioFrame

Retrieves the mixed captured and playback audio frame.

public virtual bool OnMixedAudioFrame(string channelId, AudioFrame audio_frame)
        {
            return true;
        }

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

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

Returns

Without practical meaning.

OnPlaybackAudioFrame

Gets the raw audio frame for playback.

public virtual bool OnPlaybackAudioFrame(string channelId, AudioFrame audio_frame)
        {
            return true;
        }

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

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

Returns

Without practical meaning.

OnPlaybackAudioFrameBeforeMixing

Retrieves the audio frame before mixing of subscribed remote users.

public virtual bool OnPlaybackAudioFrameBeforeMixing(string channel_id,
                                                        uint uid,
                                                        AudioFrame audio_frame)
        {
            return false;
        }

Parameters

channel_id
The channel ID.
uid
The ID of subscribed remote users.
audio_Frame
The raw audio data. See AudioFrame.

Returns

Without practical meaning.

OnRecordAudioFrame

Gets the captured audio frame.

public virtual bool OnRecordAudioFrame(string channelId, AudioFrame audioFrame)
        {
            return true;
        }

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.