Agora RTC Objective-C API Reference  Refactor
Instance Methods
<AgoraAudioFrameDelegate> Protocol Reference

Inherits <NSObject>.

Instance Methods

(BOOL) - onRecordAudioFrame:channelId:
 
(BOOL) - onPlaybackAudioFrame:channelId:
 
(BOOL) - onMixedAudioFrame:channelId:
 
(BOOL) - onPlaybackAudioFrameBeforeMixing:channelId:uid:
 

Detailed Description

The AgoraAudioFrameDelegate protocol enables audio frame callback event notifications to your application.

Method Documentation

◆ onRecordAudioFrame:channelId:

- (BOOL) onRecordAudioFrame: (AgoraAudioFrame *_Nonnull)  frame
channelId: (NSString *_Nonnull)  channelId 
required

Occurs when the recorded audio frame is received.

Parameters
frameA pointer to the audio frame: AgoraAudioFrame.
channelIdUnique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
Returns
  • true: The recorded audio frame is valid and is encoded and sent.
  • false: The recorded audio frame is invalid and is not encoded or sent.

◆ onPlaybackAudioFrame:channelId:

- (BOOL) onPlaybackAudioFrame: (AgoraAudioFrame *_Nonnull)  frame
channelId: (NSString *_Nonnull)  channelId 
required

Occurs when the playback audio frame is received.

Parameters
channelIdUnique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
frameA pointer to the audio frame: AgoraAudioFrame.
Returns
  • true: The playback audio frame is valid and is encoded and sent.
  • false: The playback audio frame is invalid and is not encoded or sent.

◆ onMixedAudioFrame:channelId:

- (BOOL) onMixedAudioFrame: (AgoraAudioFrame *_Nonnull)  frame
channelId: (NSString *_Nonnull)  channelId 
required

Occurs when the mixed audio data is received.

Parameters
frameThe A pointer to the audio frame: AgoraAudioFrame.
channelIdUnique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
Returns
  • true: The mixed audio data is valid and is encoded and sent.
  • false: The mixed audio data is invalid and is not encoded or sent.

◆ onPlaybackAudioFrameBeforeMixing:channelId:uid:

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

Occurs when the before-mixing playback audio frame is received.

Parameters
channelIdUnique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
uidID of the remote user.
frameA pointer to the audio frame: AgoraAudioFrame.
Returns
  • true: The before-mixing playback audio frame is valid and is encoded and sent.
  • false: The before-mixing playback audio frame is invalid and is not encoded or sent.