Agora RTC Objective-C API Reference  Refactor
Public Types | Public Member Functions
IAudioFrameObserver Class Referenceabstract

Inherits IAudioFrameObserverBase.

Public Types

enum  AUDIO_FRAME_TYPE { FRAME_TYPE_PCM16 = 0 }
 

Public Member Functions

virtual bool onPlaybackAudioFrameBeforeMixing (const char *channelId, rtc::uid_t uid, AudioFrame &audioFrame)=0
 
virtual bool onPlaybackAudioFrameBeforeMixing (const char *channelId, base::user_id_t userId, AudioFrame &audioFrame)
 
virtual bool onRecordAudioFrame (const char *channelId, AudioFrame &audioFrame)=0
 
virtual bool onPlaybackAudioFrame (const char *channelId, AudioFrame &audioFrame)=0
 
virtual bool onMixedAudioFrame (const char *channelId, AudioFrame &audioFrame)=0
 
virtual bool onPlaybackAudioFrameBeforeMixing (const char *channelId, base::user_id_t userId, AudioFrame &audioFrame)
 

Detailed Description

The IAudioFrameObserver class.

Member Enumeration Documentation

◆ AUDIO_FRAME_TYPE

enum AUDIO_FRAME_TYPE
inherited

Audio frame types.

Enumerator
FRAME_TYPE_PCM16 

0: 16-bit PCM.

Member Function Documentation

◆ onPlaybackAudioFrameBeforeMixing() [1/3]

virtual bool onPlaybackAudioFrameBeforeMixing ( const char *  channelId,
rtc::uid_t  uid,
AudioFrame audioFrame 
)
pure virtual

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

Parameters
channelIdThe channel name
uidID of the remote user.
audioFrameThe reference to the audio frame: AudioFrame.
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.

◆ onPlaybackAudioFrameBeforeMixing() [2/3]

virtual bool onPlaybackAudioFrameBeforeMixing
inline

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

Parameters
channelIdThe channel name
userIdID of the remote user.
audioFrameThe reference to the audio frame: AudioFrame.
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.

◆ onRecordAudioFrame()

virtual bool onRecordAudioFrame ( const char *  channelId,
AudioFrame audioFrame 
)
pure virtualinherited

Occurs when the recorded audio frame is received.

Parameters
channelIdThe channel name
audioFrameThe reference to the audio frame: AudioFrame.
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()

virtual bool onPlaybackAudioFrame ( const char *  channelId,
AudioFrame audioFrame 
)
pure virtualinherited

Occurs when the playback audio frame is received.

Parameters
channelIdThe channel name
audioFrameThe reference to the audio frame: AudioFrame.
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()

virtual bool onMixedAudioFrame ( const char *  channelId,
AudioFrame audioFrame 
)
pure virtualinherited

Occurs when the mixed audio data is received.

Parameters
channelIdThe channel name
audioFrameThe reference to the audio frame: AudioFrame.
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() [3/3]

virtual bool onPlaybackAudioFrameBeforeMixing ( const char *  channelId,
base::user_id_t  userId,
AudioFrame audioFrame 
)
inlinevirtualinherited

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

Parameters
channelIdThe channel name
userIdID of the remote user.
audioFrameThe reference to the audio frame: AudioFrame.
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.