AudioEncoder: encode() method
WebCodecs APIwindowanddedicated
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 state is not
"configured". - TypeError
- : Thrown if the
AudioDataobject has been transferred.
Examples
In the following example encode is passed an AudioData object.
encoder.encode(data);