Agora RTC Objective-C API Reference  Refactor
Data Fields
IAudioFrameObserverBase::AudioFrame Struct Reference

Data Fields

AUDIO_FRAME_TYPE type
 
int samplesPerChannel
 
agora::rtc::BYTES_PER_SAMPLE bytesPerSample
 
int channels
 
int samplesPerSec
 
void * buffer
 
int64_t renderTimeMs
 
int avsync_type
 

Detailed Description

The definition of the AudioFrame struct.

Constructor & Destructor Documentation

◆ AudioFrame()

AudioFrame ( )
inline

Field Documentation

◆ type

The audio frame type: AUDIO_FRAME_TYPE.

◆ samplesPerChannel

int samplesPerChannel

The number of samples per channel in this frame.

◆ bytesPerSample

The number of bytes per sample: #BYTES_PER_SAMPLE

◆ channels

int channels

The number of audio channels (data is interleaved, if stereo).

  • 1: Mono.
  • 2: Stereo.

◆ samplesPerSec

int samplesPerSec

The number of samples per channel in the audio frame.

◆ buffer

void* buffer

The data buffer of the audio frame. When the audio frame uses a stereo channel, the data buffer is interleaved.

Buffer data size: buffer = samples × channels × bytesPerSample.

◆ renderTimeMs

int64_t renderTimeMs

The timestamp to render the audio data.

You can use this timestamp to restore the order of the captured audio frame, and synchronize audio and video frames in video scenarios, including scenarios where external video sources are used.

◆ avsync_type

int avsync_type

A reserved parameter.