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

View in English Always switch to English

AudioDecoder:state 属性

Limited availability

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

安全上下文: 此项功能仅在一些支持的浏览器安全上下文(HTTPS)中可用。

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

AudioDecoder 接口的只读属性 state 返回底层编解码器的当前状态。

包含以下值之一的字符串:

"unconfigured"

编解码器未配置为解码。

"configured"

编解码器具有有效配置并已准备就绪。

"closed"

编解码器不再可用,系统资源已被释放。

示例

以下示例将 AudioDecoder 的状态打印到控制台。

js
console.log(AudioDecoder.state);

规范

Specification
WebCodecs
# dom-audiodecoder-state

浏览器兼容性