web api instance method
AudioEncoder: encode() method
Secure contextAvailable in workers
The encode() method of the AudioEncoder interface enqueues a control message to encode a given AudioData object.
Syntax
encode(data)
Parameters
data- : An
AudioDataobject.
- : An
Return value
None (undefined).
Exceptions
InvalidStateErrorDOMException- : Thrown if the
stateis not"configured".
- : Thrown if the
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
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.