Agora C++ API Reference for All Platforms

Loading...
Searching...
No Matches
Public Member Functions | List of all members
agora::media::IAudioFrameObserver Class Referenceabstract

`#include <AgoraMediaBase.h>`

Inherits agora::media::IAudioFrameObserverBase.

Inherited by agora::rtc::IMediaRecorderEx.

## 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)
Public Member Functions inherited from agora::media::IAudioFrameObserverBase
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 | onEarMonitoringAudioFrame (AudioFrame &audioFrame)=0
virtual int | getObservedAudioFramePosition ()=0
virtual AudioParams | getPlaybackAudioParams ()=0
virtual AudioParams | getRecordAudioParams ()=0
virtual AudioParams | getMixedAudioParams ()=0
virtual AudioParams | getEarMonitoringAudioParams ()=0

## Additional Inherited Members
Public Types inherited from agora::media::IAudioFrameObserverBase
enum | AUDIO_FRAME_TYPE { FRAME_TYPE_PCM16 = 0 }
enum | { MAX_HANDLE_TIME_CNT = 10 }
enum | AUDIO_FRAME_POSITION { AUDIO_FRAME_POSITION_NONE = 0x0000 , AUDIO_FRAME_POSITION_PLAYBACK = 0x0001 , AUDIO_FRAME_POSITION_RECORD = 0x0002 , AUDIO_FRAME_POSITION_MIXED = 0x0004 , AUDIO_FRAME_POSITION_BEFORE_MIXING = 0x0008 , AUDIO_FRAME_POSITION_EAR_MONITORING = 0x0010 }

## Detailed Description

The IAudioFrameObserver class.

## Member Function Documentation

## ◆ onPlaybackAudioFrameBeforeMixing() [1/2]

virtual bool agora::media::IAudioFrameObserver::onPlaybackAudioFrameBeforeMixing | ( | const char * | channelId,
|  | rtc::uid_t | uid,
|  | AudioFrame & | audioFrame )
| pure virtual

Retrieves the audio frame before mixing of subscribed remote users.

Parameters

  channelId | The channel ID.
  uid | The ID of subscribed remote users.
  audioFrame | The raw audio data. See `AudioFrame`.

Returns
  Without practical meaning.

## ◆ onPlaybackAudioFrameBeforeMixing() [2/2]

virtual bool agora::media::IAudioFrameObserverBase::onPlaybackAudioFrameBeforeMixing | ( | const char * | channelId,
|  | base::user_id_t | userId,
|  | AudioFrame & | audioFrame )
| inline virtual

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

Parameters

  channelId | The channel name
  userId | ID of the remote user.
  audioFrame | The 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 from agora::media::IAudioFrameObserverBase.