AudioFrame
- Electron
更新时间
原始音频数据。
export class AudioFrame {
type?: AudioFrameType;
samplesPerChannel?: number;
bytesPerSample?: BytesPerSample;
channels?: number;
samplesPerSec?: number;
buffer?: Uint8Array;
renderTimeMs?: number;
avsync_type?: number;
}属性
| 参数名 | 描述 |
|---|---|
type | 音频帧类型,详见 AudioFrameType。 |
samplesPerChannel | 每个声道的采样点数。 |
bytesPerSample | 每个采样点的字节数。对于 PCM 来说,一般使用 16 bit,即两个字节。 |
channels | 声道数量(如果是立体声,数据是交叉的)。
|
samplesPerSec | 每声道每秒的采样点数。 |
buffer | 声音数据缓存区(如果是立体声,数据是交叉存储的)。
缓存区数据大小 |
renderTimeMs | 外部音频帧的渲染时间戳。 你可以使用该时间戳还原音频帧顺序;在有视频的场景中(包含使用外部视频源的场景),该参数可以用于实现音视频同步。 |
avsync_type | 保留参数。 |