{"_id":"@audio/decode-ac3","name":"@audio/decode-ac3","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@audio/decode-ac3","version":"1.0.0","description":"Decode AC-3 (Dolby Digital) audio with liba52 WASM","type":"module","main":"decode-ac3.js","types":"decode-ac3.d.ts","exports":{".":"./decode-ac3.js","./audio":{"types":"./audio.d.ts","default":"./audio.js"},"./package.json":"./package.json"},"publishConfig":{"access":"public"},"scripts":{"build":"bash build.sh","prepack":"npm run build","test":"node test.js"},"devDependencies":{"tst":"^9.2.2"},"engines":{"node":">=18"},"keywords":["ac3","ac-3","dolby","a52","surround","5.1","audio","decode","decoder","wasm","liba52"],"license":"GPL-2.0-or-later","author":{"name":"audiojs"},"homepage":"https://github.com/audiojs/decode/tree/main/packages/decode-ac3","repository":{"type":"git","url":"git+https://github.com/audiojs/decode.git","directory":"packages/decode-ac3"},"bugs":{"url":"https://github.com/audiojs/decode/issues"},"audio":"./audio.js","sideEffects":false,"funding":"https://github.com/sponsors/audiojs","gitHead":"ee48dd74dd2dc5d3ed14de3757a295a1087e14dc","_id":"@audio/decode-ac3@1.0.0","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-GR2PLqxxrybNRwdA3/ZazB4ZWz7yQNihYtjuigGfEpSqKt95FnUgjIVfE7aJmznvxa6voq8Mou6NvSoTqH104g==","shasum":"ce228c8e438bc453e2ceb4439047830eb45c705d","tarball":"https://registry.npmjs.org/@audio/decode-ac3/-/decode-ac3-1.0.0.tgz","fileCount":9,"unpackedSize":71581,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICHYXzWx3PcreOO6NUo9PaPC7rtXANkqVWGTMoZnN+CsAiBOIEPeTCmTQKAYwEFcSg2mBeD0J8TUI/TCY4GoyjJgEA=="}]},"_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"directories":{},"maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/decode-ac3_1.0.0_1787864354635_0.22037402155095975"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-27T20:59:14.466Z","1.0.0":"2026-08-27T20:59:14.797Z","modified":"2026-08-27T20:59:15.077Z"},"maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"description":"Decode AC-3 (Dolby Digital) audio with liba52 WASM","homepage":"https://github.com/audiojs/decode/tree/main/packages/decode-ac3","keywords":["ac3","ac-3","dolby","a52","surround","5.1","audio","decode","decoder","wasm","liba52"],"repository":{"type":"git","url":"git+https://github.com/audiojs/decode.git","directory":"packages/decode-ac3"},"author":{"name":"audiojs"},"bugs":{"url":"https://github.com/audiojs/decode/issues"},"license":"GPL-2.0-or-later","readme":"# @audio/decode-ac3\n\nDecode AC-3 (Dolby Digital) to PCM float samples.<br>\n[liba52](https://code.videolan.org/videolan/liba52) compiled to a single-file WASM ES module — no side files, loads from any CDN, Node, workers and AudioWorklets.\n\n[![npm install @audio/decode-ac3](https://nodei.co/npm/@audio/decode-ac3.png?mini=true)](https://npmjs.org/package/@audio/decode-ac3/)\n\n```js\nimport decode, { decoder } from '@audio/decode-ac3'\n\nlet { channelData, sampleRate } = await decode(ac3Bytes)\n\nlet dec = await decoder()\nlet head = dec.decode(chunk1)   // synchronous; partial frames carry over\nlet tail = dec.flush()\ndec.free()\n```\n\nInput is a raw AC-3 frame stream (`.ac3`, or the frames a container demuxer extracts — [@audio/decode-mp4](../decode-mp4), [@audio/decode-webm](../decode-webm) and [@audio/decode-avi](../decode-avi) route their AC-3 tracks here). The stream's own layout is kept, up to 5.1; channels come out in WAV order: FL, FR, FC, LFE, BL, BR (surround-only or mono as present). Output level is full scale, no dialnorm applied.\n\nE-AC-3 (Dolby Digital Plus) is a different codec and is not decoded.\n\n## API\n\n### `decode(src: Uint8Array | ArrayBuffer): Promise<AudioData>`\n\nDecode a complete stream.\n\n### `decoder(): Promise<AC3Decoder>`\n\nSynchronous streaming decoder: `decode(chunk)` returns the samples of every complete frame in the data so far, `flush()` drops a trailing partial frame, `free()` releases WASM memory. `errors` counts frames that failed to decode.\n\n### `AudioData`\n\n```ts\n{ channelData: Float32Array[], sampleRate: number }\n```\n\n## License\n\n[ॐ](https://github.com/krishnized/license/) · [GPL-2.0-or-later](./LICENSE), inherited from the bundled [liba52](./LICENSE.liba52).\n","readmeFilename":"README.md","_rev":"1-9c8b2d2af7f0306675528aec9fefde5d"}