此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

EncodedAudioChunk:timestamp 属性

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

备注: 此特性在专用 Web Worker中可用。

EncodedAudioChunk 接口的 timestamp 只读属性返回表示音频的时间戳(以微秒为单位)的整数。

整型。

示例

以下示例将 timestamp 打印到控制台。

js
const init = {
  type: "key",
  data: audioBuffer,
  timestamp: 23000000,
  duration: 2000000,
};
const chunk = new EncodedAudioChunk(init);

console.log(chunk.timestamp); // 23000000

规范

Specification
WebCodecs
# dom-encodedaudiochunk-timestamp

浏览器兼容性