{"_id":"@audio/amr-decode","_rev":"2-934b6d98f4b6c7f8ede926b5945ad2eb","name":"@audio/amr-decode","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@audio/amr-decode","version":"1.0.0","keywords":["amr","amr-nb","amr-wb","audio","decode","decoder","wasm","opencore-amr","speech"],"author":{"name":"audiojs"},"license":"Apache-2.0","_id":"@audio/amr-decode@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/amr-decode#readme","bugs":{"url":"https://github.com/audiojs/amr-decode/issues"},"dist":{"shasum":"0e44d1d78246c1f0ba7ae3c5ccbc7cb5afd26cd1","tarball":"https://registry.npmjs.org/@audio/amr-decode/-/amr-decode-1.0.0.tgz","fileCount":6,"integrity":"sha512-B9T57nXhQgi7B5aVSET1Te4j9eNZVrMSL8azurD0c/FGyJwp5saLCzuC9EV3J1s/F7z5676xA7r6nsNCwAhyCQ==","signatures":[{"sig":"MEYCIQCeH3D7sUtgaPXsmfTlerjNZN4zZiaKijhPG7Azigk8hQIhAPUvfjvqiUGiM/duF1d7iHrM9nKbqtH0KBkKRWogm7Ya","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":258961},"main":"amr-decode.js","type":"module","types":"amr-decode.d.ts","engines":{"node":">=16"},"exports":{".":"./amr-decode.js","./package.json":"./package.json"},"gitHead":"e9ff3ddd03b16ee63f9f5de51434cc4c71a225b3","scripts":{"test":"node test.js","build":"bash build.sh","prepack":"npm run build"},"_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/amr-decode.git","type":"git"},"_npmVersion":"11.11.0","description":"Decode AMR-NB/WB audio via opencore-amr WASM","directories":{},"_nodeVersion":"25.8.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/amr-decode_1.0.0_1773602692639_0.7799769603033928","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2026-03-15T19:24:52.488Z","modified":"2026-04-04T03:30:12.247Z","1.0.0":"2026-03-15T19:24:52.779Z"},"bugs":{"url":"https://github.com/audiojs/amr-decode/issues"},"author":{"name":"audiojs"},"license":"Apache-2.0","homepage":"https://github.com/audiojs/amr-decode#readme","keywords":["amr","amr-nb","amr-wb","audio","decode","decoder","wasm","opencore-amr","speech"],"repository":{"url":"git+https://github.com/audiojs/amr-decode.git","type":"git"},"description":"Decode AMR-NB/WB audio via opencore-amr WASM","maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"},{"name":"jamen","email":"jamenmarz@gmail.com"}],"readme":"# amr-decode\n\nDecode AMR-NB and AMR-WB audio to PCM float samples. [opencore-amr](https://sourceforge.net/projects/opencore-amr/) compiled to WASM — works in Node.js and browsers.\n\nPart of [audio-decode](https://github.com/audiojs/audio-decode).\n\n## Install\n\n```\nnpm i @audio/amr-decode\n```\n\n## Usage\n\n```js\nimport decode from '@audio/amr-decode'\n\n// AMR-NB or AMR-WB — auto-detected from file header\nlet { channelData, sampleRate } = await decode(amrBuffer)\n// AMR-NB: 8000 Hz mono\n// AMR-WB: 16000 Hz mono\n```\n\n### Streaming\n\n```js\nimport { decoder } from '@audio/amr-decode'\n\nlet dec = await decoder()\nlet result = dec.decode(chunk)\ndec.free()\n```\n\n## API\n\n### `decode(src): Promise<AudioData>`\n\nWhole-file decode. Accepts `Uint8Array` or `ArrayBuffer`. Auto-detects AMR-NB (`#!AMR\\n`) vs AMR-WB (`#!AMR-WB\\n`).\n\n### `decoder(): Promise<AMRDecoder>`\n\nCreates a decoder instance.\n\n- **`dec.decode(data)`** — decode chunk, returns `{ channelData, sampleRate }`\n- **`dec.flush()`** — flush (returns empty)\n- **`dec.free()`** — release WASM memory\n\n## Formats\n\n- AMR-NB — 8 kHz, modes 0–7 (4.75–12.2 kbps)\n- AMR-WB — 16 kHz, modes 0–8 (6.6–23.85 kbps)\n\n## Building WASM\n\nThe WASM binary is prebuilt in `src/amr.wasm.cjs`. To rebuild:\n\n```\nnpm run build\n```\n\nThis auto-fetches opencore-amr 0.1.6 source and compiles with Emscripten.\n\n## License\n\nApache-2.0 (opencore-amr) — [krishnized](https://github.com/krishnized/license)\n","readmeFilename":"README.md"}