@audio/decode 3.13.0 → 3.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/audio-decode.js CHANGED
@@ -145,6 +145,8 @@ reg('caf', () => import('@audio/decode-caf'))
145
145
  reg('webm', () => import('@audio/decode-webm'))
146
146
  reg('mkv', () => import('@audio/decode-webm'), true)
147
147
  reg('avi', () => import('@audio/decode-avi'), true)
148
+ reg('ac3', () => import('@audio/decode-ac3'))
149
+ reg('dts', () => import('@audio/decode-dts'))
148
150
  reg('amr', () => import('@audio/decode-amr'))
149
151
  reg('wma', () => import('@audio/decode-wma'), true)
150
152
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@audio/decode",
3
- "version": "3.13.0",
3
+ "version": "3.14.0",
4
4
  "description": "Decode audio data in node or browser",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -29,20 +29,22 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@audio/decode-aac": "^1.5.0",
32
+ "@audio/decode-ac3": "^1.0.0",
32
33
  "@audio/decode-aiff": "^1.3.0",
33
34
  "@audio/decode-amr": "^1.3.0",
34
- "@audio/decode-avi": "^1.0.0",
35
+ "@audio/decode-avi": "^1.1.0",
35
36
  "@audio/decode-caf": "^1.4.0",
37
+ "@audio/decode-dts": "^1.0.0",
36
38
  "@audio/decode-flac": "^1.3.0",
37
39
  "@audio/decode-mp3": "^1.3.0",
38
- "@audio/decode-mp4": "^1.0.0",
40
+ "@audio/decode-mp4": "^1.1.0",
39
41
  "@audio/decode-opus": "^1.3.0",
40
42
  "@audio/decode-qoa": "^1.2.0",
41
43
  "@audio/decode-vorbis": "^1.3.0",
42
44
  "@audio/decode-wav": "^1.5.0",
43
- "@audio/decode-webm": "^1.5.0",
45
+ "@audio/decode-webm": "^1.6.0",
44
46
  "@audio/decode-wma": "^1.3.0",
45
- "audio-type": "^2.5.0"
47
+ "audio-type": "^2.6.0"
46
48
  },
47
49
  "devDependencies": {
48
50
  "audio-lena": "^3.0.0",
@@ -87,7 +89,9 @@
87
89
  "mkv",
88
90
  "avi",
89
91
  "video",
90
- "extract"
92
+ "extract",
93
+ "ac3",
94
+ "dts"
91
95
  ],
92
96
  "author": "Dmitry Iv. <dfcreative@gmail.com>",
93
97
  "license": "MIT",
package/readme.md CHANGED
@@ -28,6 +28,8 @@ const { channelData, sampleRate } = await decode(anyAudioBuffer);
28
28
  | CAF | [@audio/decode-caf](./packages/decode-caf) | 9 KB | JS |
29
29
  | WebM / MKV video | [@audio/decode-webm](./packages/decode-webm) | 250 KB | WASM |
30
30
  | AVI video | [@audio/decode-avi](./packages/decode-avi) | 8 KB + codec | JS demux |
31
+ | AC-3 | [@audio/decode-ac3](./packages/decode-ac3) | 43 KB | WASM |
32
+ | DTS | [@audio/decode-dts](./packages/decode-dts) | 200 KB | WASM |
31
33
  | AMR | [@audio/decode-amr](./packages/decode-amr) | 241 KB | WASM |
32
34
  | WMA | [@audio/decode-wma](./packages/decode-wma) | 91 KB | WASM |
33
35
 
@@ -65,7 +67,7 @@ for await (let { channelData, sampleRate } of decode.mp3(response.body)) {
65
67
 
66
68
  Works with `ReadableStream`, `fetch` body, Node stream, or any async iterable.
67
69
 
68
- Formats: `mp3`, `flac`, `opus`, `oga`, `m4a`, `mp4`, `mov`, `wav`, `qoa`, `aac`, `aiff`, `caf`, `webm`, `mkv`, `avi`, `amr`, `wma`.
70
+ Formats: `mp3`, `flac`, `opus`, `oga`, `m4a`, `mp4`, `mov`, `wav`, `qoa`, `aac`, `aiff`, `caf`, `webm`, `mkv`, `avi`, `ac3`, `dts`, `amr`, `wma`.
69
71
 
70
72
  ### Video files
71
73
 
@@ -77,11 +79,11 @@ let { channelData, sampleRate } = await decode(await fetch('trailer.mp4'))
77
79
 
78
80
  | Container | Package | Audio codecs |
79
81
  |---|---|---|
80
- | MP4, MOV, M4V, 3GP | [@audio/decode-mp4](./packages/decode-mp4) | AAC, ALAC, MP3, FLAC, Opus, AMR, PCM, G.711 |
81
- | WebM, MKV | [@audio/decode-webm](./packages/decode-webm) | Opus, Vorbis, AAC, ALAC, MP3, FLAC, PCM |
82
- | AVI | [@audio/decode-avi](./packages/decode-avi) | PCM, MP3, AAC, G.711 |
82
+ | MP4, MOV, M4V, 3GP | [@audio/decode-mp4](./packages/decode-mp4) | AAC, ALAC, MP3, FLAC, Opus, AC-3, DTS, AMR, PCM, G.711 |
83
+ | WebM, MKV | [@audio/decode-webm](./packages/decode-webm) | Opus, Vorbis, AAC, ALAC, MP3, FLAC, AC-3, DTS, PCM |
84
+ | AVI | [@audio/decode-avi](./packages/decode-avi) | PCM, MP3, AAC, AC-3, DTS, G.711 |
83
85
 
84
- AC-3, E-AC-3 and DTS tracks throw an error naming the codec.
86
+ Surround tracks keep their layout (up to 5.1, WAV channel order). E-AC-3 and TrueHD tracks throw an error naming the codec.
85
87
 
86
88
  ### Browser
87
89
 
@@ -175,6 +177,6 @@ worker.onmessage = ({ data }) => { /* { channelData, sampleRate } */ }
175
177
 
176
178
  ## Licensing
177
179
 
178
- The umbrella and most codec packages are MIT. Three codecs use another license: <a href="./packages/decode-aac">@audio/decode-aac</a> GPL-2.0, <a href="./packages/decode-wma">@audio/decode-wma</a> GPL-2.0-or-later, and <a href="./packages/decode-amr">@audio/decode-amr</a> Apache-2.0. Install only the codecs whose licenses fit your project. The umbrella loads them on demand.
180
+ The umbrella and most codec packages are MIT. Five codecs use another license: <a href="./packages/decode-aac">@audio/decode-aac</a> GPL-2.0, <a href="./packages/decode-wma">@audio/decode-wma</a>, <a href="./packages/decode-ac3">@audio/decode-ac3</a> and <a href="./packages/decode-dts">@audio/decode-dts</a> GPL-2.0-or-later, and <a href="./packages/decode-amr">@audio/decode-amr</a> Apache-2.0. Install only the codecs whose licenses fit your project. The umbrella loads them on demand.
179
181
 
180
182
  <p align="center"><a href="https://github.com/krishnized/license/">ॐ</a> · <a href="./LICENSE">MIT</a>
package/test.html CHANGED
@@ -35,6 +35,8 @@
35
35
  "@audio/decode-mp4": "./packages/decode-mp4/decode-mp4.js",
36
36
  "@audio/decode-avi": "./packages/decode-avi/decode-avi.js",
37
37
  "@audio/decode-opus/core": "./packages/decode-opus/core.js",
38
+ "@audio/decode-ac3": "./packages/decode-ac3/decode-ac3.js",
39
+ "@audio/decode-dts": "./packages/decode-dts/decode-dts.js",
38
40
  "@audio/decode-amr": "./packages/decode-amr/decode-amr.js",
39
41
  "@audio/decode-wma": "./packages/decode-wma/decode-wma.js"
40
42
  }