-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
45 lines (30 loc) · 1.02 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
title: "AudioDecoder: decode() method"
short-title: decode()
slug: Web/API/AudioDecoder/decode
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.AudioDecoder.decode
---
{{securecontext_header}}{{APIRef("WebCodecs API")}}{{AvailableInWorkers("window_and_dedicated")}}{{SeeCompatTable}}
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 `chunk` is unable to be decoded due to relying on other frames for decoding.
## Examples
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}