AudioDecoder: decode() method
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{securecontext_header}}{{APIRef("WebCodecs API")}}{{AvailableInWorkers("window_and_dedicated")}}
The **decode()** method of the {{domxref("AudioDecoder")}} interface enqueues a control message to decode a given chunk of audio.
Syntax
js-nolint
decode(chunk)Parameters
chunk- : An {{domxref("EncodedAudioChunk")}} object representing a chunk of encoded audio.
Return value
None ({{jsxref("undefined")}}).
Exceptions
InvalidStateError{{domxref("DOMException")}}- : Thrown if the {{domxref("AudioDecoder.state","state")}} is not
"configured". DataError{{domxref("DOMException")}}- : Thrown if the
chunkis unable to be decoded due to relying on other frames for decoding.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}