AgoraAudioFrameDelegate Category Reference

Conforms to NSObject
Declared in AgoraAudioFrame.h

Overview

The delegate of the raw audio data.

– onRecordAudioFrame: required method

Gets the recorded raw audio data.

- (BOOL)onRecordAudioFrame:(AgoraAudioFrame *_Nonnull)frame

Parameters

frame

The raw audio data. For details, see AgoraAudioFrame.

Return Value

  • YES: The audio data is valid, and will be sent to the SDK.
  • NO: The audio data is invalid, and will not be sent to the SDK.

Availability

v3.3.0

Discussion

Note: To ensure that the captured audio frame has the expected format, Agora recommends that you call setRecordingAudioFrameParametersWithSampleRate to set the audio capturing format.

Declared In

AgoraAudioFrame.h

– onPlaybackAudioFrame: required method

Gets the playback raw audio data.

- (BOOL)onPlaybackAudioFrame:(AgoraAudioFrame *_Nonnull)frame

Parameters

frame

The raw audio data. For details, see AgoraAudioFrame.

Return Value

  • YES: The audio data is valid, and will be sent to the SDK.
  • NO: The audio data is invalid, and will not be sent to the SDK.

Availability

v3.3.0

Discussion

Note: To ensure that the audio playback frame has the expected format, Agora recommends that you call setPlaybackAudioFrameParametersWithSampleRate to set the audio playback format.

Declared In

AgoraAudioFrame.h

– onMixedAudioFrame: required method

Receives the mixed raw audio data of the local user and all remote users.

- (BOOL)onMixedAudioFrame:(AgoraAudioFrame *_Nonnull)frame

Parameters

frame

The raw audio data. For details, see AgoraAudioFrame.

Return Value

  • YES: The audio data is valid, and will be sent to the SDK.
  • NO: The audio data is invalid, and will not be sent to the SDK.

Availability

v3.3.0

The SDK periodically triggers this callback according to the sample interval set by the setMixedAudioFrameParametersWithSampleRate method. You can retrieve the mixed audio data of the local and remote users from this callback.

Discussion

Note: To ensure that the mixed captured and playback audio frame has the expected format, Agora recommends that you call setMixedAudioFrameParametersWithSampleRate to set the mixed audio format.

Declared In

AgoraAudioFrame.h

– onPlaybackAudioFrameBeforeMixing:uid: required method

Gets the raw audio data of a remote user before mixing.

- (BOOL)onPlaybackAudioFrameBeforeMixing:(AgoraAudioFrame *_Nonnull)frame uid:(NSUInteger)uid

Parameters

frame

The raw audio data. For details, see AgoraAudioFrame.

uid

The user ID.

Return Value

  • YES: The audio data is valid, and will be sent to the SDK.
  • NO: The audio data is invalid, and will not be sent to the SDK.

Availability

v3.3.0

After you register the audio frame observer, the SDK triggers this callback every time it captures an audio frame.

Discussion

Note: To ensure that the audio playback frame has the expected format, Agora recommends that you call setPlaybackAudioFrameParametersWithSampleRate to set the audio playback format.

Declared In

AgoraAudioFrame.h