Agora Server Gateway SDK C++ API Reference
Classes | Public Types | Public Member Functions | List of all members
IAudioFrameObserverBase Class Referenceabstract

#include <AgoraMediaBase.h>

Classes

struct  AudioFrame
 

Public Types

enum  AUDIO_FRAME_TYPE { FRAME_TYPE_PCM16 = 0 }
 

Public Member Functions

virtual ~IAudioFrameObserverBase ()
 
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 IAudioFrameObserverBase class.

Member Enumeration Documentation

◆ AUDIO_FRAME_TYPE

Audio frame types.

Enumerator
FRAME_TYPE_PCM16 

0: 16-bit PCM.

Constructor & Destructor Documentation

◆ ~IAudioFrameObserverBase()

virtual IAudioFrameObserverBase::~IAudioFrameObserverBase ( )
inlinevirtual

Member Function Documentation

◆ onMixedAudioFrame()

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

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.

◆ onPlaybackAudioFrame()

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

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.

◆ onPlaybackAudioFrameBeforeMixing()

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

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

Parameters
channelIdA null pointer
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.

Reimplemented in IAudioFrameObserver.

◆ onRecordAudioFrame()

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

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.

The documentation for this class was generated from the following file: