AudioFrame
Raw audio data.
export class AudioFrame {
type?: AudioFrameType;
samplesPerChannel?: number;
bytesPerSample?: BytesPerSample;
channels?: number;
samplesPerSec?: number;
buffer?: Uint8Array;
renderTimeMs?: number;
avsync_type?: number;
}
Properties
- type
- Audio frame type. See AudioFrameType.
- samplesPerChannel
- Number of samples per channel.
- bytesPerSample
- Number of bytes per sample. For PCM, 16-bit (2 bytes) is typically used.
- channels
- Number of channels (if stereo, the data is interleaved).
- 1: Mono
- 2: Stereo
- samplesPerSec
- Number of samples per second per channel.
- buffer
- Audio data buffer (if stereo, the data is interleaved).
Buffer data size
buffer=samples×channels×bytesPerSample. - renderTimeMs
- Render timestamp of the external audio frame. You can use this timestamp to restore the order of audio frames; in scenarios with video (including those using external video sources), this parameter can be used to achieve audio-video synchronization.
- avsync_type
- Reserved parameter.