Agora Java API Reference for Android

Public Member Functions | List of all members
agora::media::IAudioFrameObserver Class Referenceabstract

`#include <AgoraMediaBase.h>`

Inheritance diagram for agora::media::IAudioFrameObserver:

## Public Member Functions
virtual bool | onPlaybackAudioFrameBeforeMixing (const char *channelId, rtc::uid_t uid, AudioFrame &audioFrame)=0
| Retrieves the audio frame before mixing of subscribed remote users. More...
virtual bool | onPlaybackAudioFrameBeforeMixing (const char *channelId, base::user_id_t userId, AudioFrame &audioFrame)
Public Member Functions inherited from agora::media::IAudioFrameObserverBase
virtual bool | onRecordAudioFrame (const char *channelId, AudioFrame &audioFrame)=0
| Gets the captured audio frame. More...
virtual bool | onPlaybackAudioFrame (const char *channelId, AudioFrame &audioFrame)=0
| Gets the raw audio frame for playback. More...
virtual bool | onMixedAudioFrame (const char *channelId, AudioFrame &audioFrame)=0
| Retrieves the mixed captured and playback audio frame. More...
virtual bool | onEarMonitoringAudioFrame (AudioFrame &audioFrame)=0
| Gets the in-ear monitoring audio frame. More...
virtual bool | onPlaybackAudioFrameBeforeMixing (const char *channelId, base::user_id_t userId, AudioFrame &audioFrame)
virtual int | getObservedAudioFramePosition ()=0
| Sets the frame position for the video observer. More...
virtual AudioParams | getPlaybackAudioParams ()=0
| Sets the audio format for the `onPlaybackAudioFrame` callback. More...
virtual AudioParams | getRecordAudioParams ()=0
| Sets the audio format for the `onRecordAudioFrame` callback. More...
virtual AudioParams | getMixedAudioParams ()=0
| Sets the audio format for the `onMixedAudioFrame` callback. More...
virtual AudioParams | getEarMonitoringAudioParams ()=0
| Sets the audio format for the `onEarMonitoringAudioFrame` callback. More...

## Additional Inherited Members
Public Types inherited from agora::media::IAudioFrameObserverBase
enum | AUDIO_FRAME_TYPE { FRAME_TYPE_PCM16 = 0 }
| Audio frame type. More...
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

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.