WebCodecs APIwindow_and_dedicated
The encode() method of the AudioEncoder interface enqueues a control message to encode a given AudioData object.
Syntax
encode(data)
Parameters
data- : An AudioData object.
Return value
None (undefined).
Exceptions
InvalidStateErrorDOMException- : Thrown if the AudioEncoder.state is not
"configured".
- : Thrown if the AudioEncoder.state is not
- TypeError
- : Thrown if the
AudioDataobject has been transferred.
- : Thrown if the
Examples
In the following example encode is passed an AudioData object.
encoder.encode(data);
Specifications
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
