{"_id":"@audio/decode-avi","_rev":"2-a858d1a8970029900a4398fd018c38fd","name":"@audio/decode-avi","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@audio/decode-avi","version":"1.0.0","keywords":["avi","riff","opendml","demux","video","audio","decode","decoder","pcm","mp3","aac"],"author":{"name":"audiojs"},"license":"MIT","_id":"@audio/decode-avi@1.0.0","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"homepage":"https://github.com/audiojs/decode/tree/main/packages/decode-avi","bugs":{"url":"https://github.com/audiojs/decode/issues"},"dist":{"shasum":"24fa8cca170cefb7dc510930489137df81a286d6","tarball":"https://registry.npmjs.org/@audio/decode-avi/-/decode-avi-1.0.0.tgz","fileCount":7,"integrity":"sha512-tM30Fu8joN800HRs4Y3a3Rfm21jF8BNFef6IwvnLlRfBhunmY9Hv7IkbJyGf/colE5peYwe2OmXqA1j133REVQ==","signatures":[{"sig":"MEQCIEHZE2JOldncsUngihpE76ZlSJ+VlJ2I6DX4JvVjrCDfAiB+zT8iPe+3QVmZ5Bs2Ma7vI1MpGeqyYqdC10czKUwarA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15861},"main":"decode-avi.js","type":"module","audio":"./audio.js","types":"decode-avi.d.ts","engines":{"node":">=18"},"exports":{".":"./decode-avi.js","./audio":{"types":"./audio.d.ts","default":"./audio.js"},"./package.json":"./package.json"},"funding":"https://github.com/sponsors/audiojs","gitHead":"6dbdbc0c63037395ce6574a318121a0f4682279a","scripts":{"test":"node test.js"},"_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/decode.git","type":"git","directory":"packages/decode-avi"},"_npmVersion":"11.12.1","description":"Decode the audio stream of AVI files (PCM, MP3, AAC, µ-law, A-law) to PCM samples","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/decode-aac":"^1.5.0","@audio/decode-mp3":"^1.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tst":"^9.2.2"},"_npmOperationalInternal":{"tmp":"tmp/decode-avi_1.0.0_1787857237139_0.4095304426117805","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@audio/decode-avi","version":"1.1.0","description":"Decode the audio stream of AVI files (PCM, MP3, AAC, µ-law, A-law) to PCM samples","type":"module","main":"decode-avi.js","types":"decode-avi.d.ts","exports":{".":"./decode-avi.js","./audio":{"types":"./audio.d.ts","default":"./audio.js"},"./package.json":"./package.json"},"publishConfig":{"access":"public"},"scripts":{"test":"node test.js"},"dependencies":{"@audio/decode-aac":"^1.5.0","@audio/decode-ac3":"^1.0.0","@audio/decode-dts":"^1.0.0","@audio/decode-mp3":"^1.3.0"},"devDependencies":{"tst":"^9.2.2"},"engines":{"node":">=18"},"keywords":["avi","riff","opendml","demux","video","audio","decode","decoder","pcm","mp3","aac"],"license":"MIT","author":{"name":"audiojs"},"homepage":"https://github.com/audiojs/decode/tree/main/packages/decode-avi","repository":{"type":"git","url":"git+https://github.com/audiojs/decode.git","directory":"packages/decode-avi"},"bugs":{"url":"https://github.com/audiojs/decode/issues"},"audio":"./audio.js","sideEffects":false,"funding":"https://github.com/sponsors/audiojs","gitHead":"ee48dd74dd2dc5d3ed14de3757a295a1087e14dc","_id":"@audio/decode-avi@1.1.0","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-/EczjSR5RG1ZfRZ3aJy1XD82/g54wfqpq+CCo3tooiEvumGpAhUSmAMnQtdJrmE1cY+iximJYwpvjQhJKNDmdg==","shasum":"f456f11f124f5b3c842288e00b255e496b2c8cfc","tarball":"https://registry.npmjs.org/@audio/decode-avi/-/decode-avi-1.1.0.tgz","fileCount":7,"unpackedSize":16286,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDtUvWxUhgSjboqiLz4x6ShJTOqpEUt+HDhRFbaZwHQ9wIhALvazvdgfqN+KgBoNCx7iJRl90pd1q1Pz7c2/yZWunga"}]},"_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-avi_1.1.0_1787864358488_0.40233934429663387"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-27T19:00:36.912Z","modified":"2026-08-27T20:59:18.817Z","1.0.0":"2026-08-27T19:00:37.289Z","1.1.0":"2026-08-27T20:59:18.627Z"},"bugs":{"url":"https://github.com/audiojs/decode/issues"},"author":{"name":"audiojs"},"license":"MIT","homepage":"https://github.com/audiojs/decode/tree/main/packages/decode-avi","keywords":["avi","riff","opendml","demux","video","audio","decode","decoder","pcm","mp3","aac"],"repository":{"type":"git","url":"git+https://github.com/audiojs/decode.git","directory":"packages/decode-avi"},"description":"Decode the audio stream of AVI files (PCM, MP3, AAC, µ-law, A-law) to PCM samples","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"readme":"# @audio/decode-avi\n\nDecode the audio stream of AVI files to PCM float samples.<br>\nA pure-JS RIFF/AVI demuxer (OpenDML `AVIX` extensions included) that skips the video stream and routes the audio to the matching codec package, loaded on demand.\n\n[![npm install @audio/decode-avi](https://nodei.co/npm/@audio/decode-avi.png?mini=true)](https://npmjs.org/package/@audio/decode-avi/)\n\n```js\nimport decode, { decoder } from '@audio/decode-avi'\n\nlet { channelData, sampleRate } = await decode(aviBytes)\n\nlet dec = await decoder()\nlet head = await dec.decode(chunk1)   // Promise on the chunk that completes the stream headers\nlet more = dec.decode(chunk2)         // synchronous from then on\nlet tail = await dec.flush()\ndec.free()\n```\n\n## Codecs\n\n| `wFormatTag` | Codec | Decoded by |\n|---|---|---|\n| `0x0001`, `0x0003` (and `WAVE_FORMAT_EXTENSIBLE`) | PCM 8–32 bit int, 32/64 bit float | built in |\n| `0x0006`, `0x0007` | G.711 A-law, µ-law | built in |\n| `0x0055` | MP3 | [@audio/decode-mp3](../decode-mp3) |\n| `0x00FF` | AAC | [@audio/decode-aac](../decode-aac) |\n| `0x2000` | AC-3 | [@audio/decode-ac3](../decode-ac3) |\n| `0x2001` | DTS | [@audio/decode-dts](../decode-dts) |\n\nWMA and ADPCM streams throw an error naming the codec. The first `auds` stream is decoded.\n\nCodec packages are imported dynamically, which is unavailable inside an AudioWorklet — decode in the main thread or a Worker.\n\n## API\n\n### `decode(src: Uint8Array | ArrayBuffer): Promise<AudioData>`\n\nDecode a complete file.\n\n### `decoder(): Promise<AVIDecoder>`\n\nStreaming decoder. `decode(chunk)` returns `AudioData`, or a Promise of it on the chunk that completes the stream headers while the codec module loads. `flush()` returns remaining samples and throws if no audio stream was found. `free()` releases codec resources.\n\n### `AudioData`\n\n```ts\n{ channelData: Float32Array[], sampleRate: number }\n```\n\n## License\n\n[ॐ](https://github.com/krishnized/license/) · [MIT](./LICENSE). Codec packages carry their own licenses.\n","readmeFilename":"README.md"}