Agora RTC Objective-C API Reference Refactor

Properties
AgoraAudioFrame Class Reference

Inherits <NSObject>.

## Properties
NSInteger | samplesPerChannel
NSInteger | bytesPerSample
NSInteger | channels
NSInteger | samplesPerSec
void *_Nullable | buffer
int64_t | renderTimeMs
NSInteger | avSyncType
uint32_t | rtpTimestamp

## Detailed Description

The class of AgoraAudioFrame.

## Property Documentation

## ◆ samplesPerChannel

- (NSInteger) samplesPerChannel
| read write nonatomic assign

The number of samples per channel.

## ◆ bytesPerSample

- (NSInteger) bytesPerSample
| read write nonatomic assign

The number of bytes per audio sample. For example, each PCM audio sample usually takes up 16 bits (2 bytes).

## ◆ channels

- (NSInteger) channels
| read write nonatomic assign

The number of audio channels. If the channel uses stereo, the data is interleaved.

- 1: Mono.
- 2: Stereo.

## ◆ samplesPerSec

- (NSInteger) samplesPerSec
| read write nonatomic assign

The sample rate.

## ◆ buffer

- (void* _Nullable) buffer
| read write nonatomic assign

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

## ◆ renderTimeMs

- (int64_t) renderTimeMs
| read write nonatomic assign

The timestamp 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.

## ◆ presentationMs

- (int64_t) presentationMs
| read write nonatomic assign

## ◆ avSyncType

- (NSInteger) avSyncType
| read write nonatomic assign

Reserved for future use.

## ◆ rtpTimestamp

- (uint32_t) rtpTimestamp
| read write nonatomic assign

RTP timestamp of the first sample in the audio frame