Classes

struct  AudioFrame
 

Public Types

enum  AUDIO_FRAME_TYPE { FRAME_TYPE_PCM16 = 0 }
 

Public Member Functions

virtual bool onRecordAudioFrame (AudioFrame &audioFrame)=0
 
virtual bool onPlaybackAudioFrame (AudioFrame &audioFrame)=0
 
virtual bool onMixedAudioFrame (AudioFrame &audioFrame)=0
 
virtual bool onPlaybackAudioFrameBeforeMixing (unsigned int uid, AudioFrame &audioFrame)=0
 

Detailed Description

Member Enumeration Documentation

◆ AUDIO_FRAME_TYPE

The frame type.

Enumerator
FRAME_TYPE_PCM16 

0: PCM16.

Member Function Documentation

◆ onRecordAudioFrame()

virtual bool agora::media::IAudioFrameObserver::onRecordAudioFrame ( AudioFrame audioFrame)
pure virtual

Retrieves the recorded audio frame.

The SDK triggers this callback once every 10 ms.

Parameters
audioFramePointer to AudioFrame.
Returns
  • true: Valid buffer in AudioFrame, and the recorded audio frame is sent out.
  • false: Invalid buffer in AudioFrame, and the recorded audio frame is discarded.

◆ onPlaybackAudioFrame()

virtual bool agora::media::IAudioFrameObserver::onPlaybackAudioFrame ( AudioFrame audioFrame)
pure virtual

Retrieves the audio playback frame every 10 ms for getting the audio.

Parameters
audioFramePointer to AudioFrame.
Returns
  • true: Valid buffer in AudioFrame, and the audio playback frame is sent out.
  • false: Invalid buffer in AudioFrame, and the audio playback frame is discarded.

◆ onMixedAudioFrame()

virtual bool agora::media::IAudioFrameObserver::onMixedAudioFrame ( AudioFrame audioFrame)
pure virtual

Retrieves the mixed recorded and playback audio frame.

The SDK triggers this callback once every 10 ms.

Note
This callback only returns the single-channel data.
Parameters
audioFramePointer to AudioFrame.
Returns
  • true: Valid buffer in AudioFrame and the mixed recorded and playback audio frame is sent out.
  • false: Invalid buffer in AudioFrame and the mixed recorded and playback audio frame is discarded.

◆ onPlaybackAudioFrameBeforeMixing()

virtual bool agora::media::IAudioFrameObserver::onPlaybackAudioFrameBeforeMixing ( unsigned int  uid,
AudioFrame audioFrame 
)
pure virtual

Retrieves the audio frame of a specified user before mixing.

The SDK triggers this callback once every 10 ms.

Parameters
uidThe user ID
audioFramePointer to AudioFrame.
Returns
  • true: Valid buffer in AudioFrame, and the mixed recorded and playback audio frame is sent out.
  • false: Invalid buffer in AudioFrame, and the mixed recorded and playback audio frame is discarded.