Agora C++ API Reference for All Platforms
agora::media::IAudioFrameObserver::AudioFrame Struct Reference

#include <IAgoraMediaEngine.h>

Public Attributes

AUDIO_FRAME_TYPE type
 
int samples
 
int bytesPerSample
 
int channels
 
int samplesPerSec
 
void * buffer
 
int64_t renderTimeMs
 
int avsync_type
 

Detailed Description

Definition of AudioFrame

Member Data Documentation

◆ type

AUDIO_FRAME_TYPE agora::media::IAudioFrameObserver::AudioFrame::type

The type of the audio frame. See AUDIO_FRAME_TYPE

◆ samples

int agora::media::IAudioFrameObserver::AudioFrame::samples

The number of samples per channel in the audio frame.

◆ bytesPerSample

int agora::media::IAudioFrameObserver::AudioFrame::bytesPerSample

The number of bytes per audio sample, which is usually 16-bit (2-byte).

◆ channels

int agora::media::IAudioFrameObserver::AudioFrame::channels

The number of audio channels.

  • 1: Mono
  • 2: Stereo (the data is interleaved)

◆ samplesPerSec

int agora::media::IAudioFrameObserver::AudioFrame::samplesPerSec

The sample rate.

◆ buffer

void* agora::media::IAudioFrameObserver::AudioFrame::buffer

The data buffer of the audio frame. When the audio frame uses a stereo channel, the data buffer is interleaved. The size of the data buffer is as follows: buffer = samples × channels × bytesPerSample.

◆ renderTimeMs

int64_t agora::media::IAudioFrameObserver::AudioFrame::renderTimeMs

The timestamp (ms) of the external audio frame. You can use this parameter for the following purposes:

  • Restore the order of the captured audio frame.
  • Synchronize audio and video frames in video-related scenarios, including where external video sources are used.

◆ avsync_type

int agora::media::IAudioFrameObserver::AudioFrame::avsync_type

Reserved parameter.