You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3c19e93
Browse filesBrowse the repository at this point in the historyBrowse files
let fromUrl =awaitdecode(awaitfetch(url)) // Response
43
43
```
44
44
45
-
### Synchronous codecs
46
-
47
-
The umbrella remains async for detection, lazy imports, and `Blob`/`Response` inputs.
48
-
Import a codec package directly for synchronous calls.
49
-
50
-
`wav`, `qoa`, `aiff`, and `caf` are synchronous:
51
-
52
-
```js
53
-
importdecodefrom'@audio/decode-wav'
54
-
let pcm =decode(wavBytes)
55
-
```
56
-
57
-
WASM codecs initialize asynchronously, then decode synchronously:
58
-
59
-
```js
60
-
import { decoder } from'@audio/decode-flac'
61
-
let dec =awaitdecoder()
62
-
let pcm =dec.decode(bytes)
63
-
let tail =dec.flush()
64
-
dec.free()
65
-
```
66
-
67
45
### Chunked
68
46
69
47
```js
@@ -100,6 +78,29 @@ Works from a CDN without a bundler. Codecs load on demand via dynamic import, on
100
78
101
79
For self-hosting, use an import map to point `@audio/decode` and each needed `@audio/decode-*` package to local files. Codec-internal files load by relative path.
102
80
81
+
82
+
### Synchronous codecs
83
+
84
+
The umbrella remains async for detection, lazy imports, and `Blob`/`Response` inputs.
85
+
Import a codec package directly for synchronous calls.
86
+
87
+
`wav`, `qoa`, `aiff`, and `caf` are synchronous:
88
+
89
+
```js
90
+
importdecodefrom'@audio/decode-wav'
91
+
let pcm =decode(wavBytes)
92
+
```
93
+
94
+
WASM codecs initialize asynchronously, then decode synchronously:
95
+
96
+
```js
97
+
import { decoder } from'@audio/decode-flac'
98
+
let dec =awaitdecoder()
99
+
let pcm =dec.decode(bytes)
100
+
let tail =dec.flush()
101
+
dec.free()
102
+
```
103
+
103
104
### Metadata
104
105
105
106
Read tags, pictures, markers and regions without decoding samples. Available for
0 commit comments