{"_id":"stb-vorbis","_rev":"6-d8a451a556d7afe2e09c0ea54351570e","name":"stb-vorbis","dist-tags":{"latest":"0.0.6"},"versions":{"0.0.2":{"name":"stb-vorbis","version":"0.0.2","keywords":["ogg","vorbis","audio","audio-decoder","pcm","stb-vorbis","stb_vorbis","wasm","webassembly","javascript","typescript","audioworklet","audio-worklet","browser"],"author":{"url":"https://github.com/spessasus","name":"spessasus","email":"spesekspesek@gmail.com"},"license":"Apache-2.0","_id":"stb-vorbis@0.0.2","maintainers":[{"name":"spesek","email":"spesekspesek@gmail.com"}],"homepage":"https://github.com/spessasus/stb-vorbis#readme","bugs":{"url":"https://github.com/spessasus/stb-vorbis/issues","email":"spesekspesek@gmail.com"},"dist":{"shasum":"6b7b285eb30ed1193cc44a8badf5aa2467cc838b","tarball":"https://registry.npmjs.org/stb-vorbis/-/stb-vorbis-0.0.2.tgz","fileCount":5,"integrity":"sha512-dF5cXJWVu252Dzi6kQ5XDKKvW18Sz9LnnGn86w2aLIPadDDfr48zPnuRqp/Y6z7yuupHDFtCf/MtPwH63obD7Q==","signatures":[{"sig":"MEUCIQD8ZEQrWq6RlTub2UlPsaQxQtYQvu8BiyiPs2AGSF7mbgIgKQTRG6LVIs+x7NEc2ZmYXvB+85F/u3xPCZ4QBzh/zSw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":136246},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"e93771c55a49cde10bd7719d1228b56375e364c5","scripts":{"lint":"eslint .","build":"npm run test:types && npm run build:wasm","format":"prettier . --write","build:wasm":"tsx scripts/build-wasm.ts","test:types":"npm run lint && tsc -b","prepublishOnly":"npm run build"},"_npmUser":{"name":"spesek","email":"spesekspesek@gmail.com"},"repository":{"url":"git+https://github.com/spessasus/stb-vorbis.git","type":"git"},"_npmVersion":"12.0.1","description":"Synchronous Ogg Vorbis decoder for JavaScript and WebAssembly","directories":{},"_nodeVersion":"26.4.0","allowScripts":{"esbuild@0.28.2":true},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.11","eslint":"^10.8.1","esbuild":"^0.28.2","globals":"^17.9.0","prettier":"^3.9.6","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.2.0","typescript-eslint":"^8.66.0","eslint-plugin-unicorn":"^73.0.0","eslint-config-prettier":"^10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/stb-vorbis_0.0.2_1786305746376_0.5293700975926323","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Only the latest version of stb-vorbis is supported."},"0.0.3":{"name":"stb-vorbis","version":"0.0.3","keywords":["ogg","vorbis","audio","audio-decoder","pcm","stb-vorbis","stb_vorbis","wasm","webassembly","javascript","typescript","audioworklet","audio-worklet","browser"],"author":{"url":"https://github.com/spessasus","name":"spessasus","email":"spesekspesek@gmail.com"},"license":"Apache-2.0","_id":"stb-vorbis@0.0.3","maintainers":[{"name":"spesek","email":"spesekspesek@gmail.com"}],"homepage":"https://github.com/spessasus/stb-vorbis#readme","bugs":{"url":"https://github.com/spessasus/stb-vorbis/issues","email":"spesekspesek@gmail.com"},"dist":{"shasum":"eb3cbd1591afa8f5e7e98280591a8bcc015d5b0a","tarball":"https://registry.npmjs.org/stb-vorbis/-/stb-vorbis-0.0.3.tgz","fileCount":5,"integrity":"sha512-KNjOkOrzfehtD6XEL7t7w8aa6CCMy6jkYH27SGQNBGYA0Q0oAc5jnX0AN4MN1RFNczmsqQwd66I9g3AtyNSSpQ==","signatures":[{"sig":"MEUCIGeiRTTODwqJRRGzlGoAmDtNCRfmKKxzzwAAthmtLgE6AiEA04Of7rcjkSQdM6u6p6NdAbK24Dr2QP2FDlbs4jJXF0U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/stb-vorbis@0.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":136081},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"ff13607e62e4e898efe405740842a8b48822a47b","scripts":{"lint":"eslint .","build":"npm run test:types && npm run build:wasm","format":"prettier . --write","build:wasm":"tsx scripts/build-wasm.ts","test:types":"npm run lint && tsc -b","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3e21898e-cb73-4a93-8ac0-22715bb39b18"}},"repository":{"url":"git+https://github.com/spessasus/stb-vorbis.git","type":"git"},"_npmVersion":"11.19.0","description":"Synchronous Ogg Vorbis decoder for JavaScript and WebAssembly","directories":{},"_nodeVersion":"26.7.0","allowScripts":{"esbuild@0.28.2":true},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.11","eslint":"^10.8.1","esbuild":"^0.28.2","globals":"^17.9.0","prettier":"^3.9.6","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.2.0","typescript-eslint":"^8.66.0","eslint-plugin-unicorn":"^73.0.0","eslint-config-prettier":"^10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/stb-vorbis_0.0.3_1786306699830_0.608963337574032","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Only the latest version of stb-vorbis is supported."},"0.0.4":{"name":"stb-vorbis","version":"0.0.4","keywords":["ogg","vorbis","audio","audio-decoder","pcm","stb-vorbis","stb_vorbis","wasm","webassembly","javascript","typescript","audioworklet","audio-worklet","browser"],"author":{"url":"https://github.com/spessasus","name":"spessasus","email":"spesekspesek@gmail.com"},"license":"Apache-2.0","_id":"stb-vorbis@0.0.4","maintainers":[{"name":"spesek","email":"spesekspesek@gmail.com"}],"homepage":"https://github.com/spessasus/stb-vorbis#readme","bugs":{"url":"https://github.com/spessasus/stb-vorbis/issues","email":"spesekspesek@gmail.com"},"dist":{"shasum":"294aa6b9b2902423adb41179d6e6c448be10126f","tarball":"https://registry.npmjs.org/stb-vorbis/-/stb-vorbis-0.0.4.tgz","fileCount":5,"integrity":"sha512-NF8Su0FUPY4KAbXRQgOHfpbtiltzVfMU47NUgV08Dvz0F3PuChX4R80chbHvth4zvVjtYzsv2alScp+a4eptfA==","signatures":[{"sig":"MEQCIGqEj5JAyZV4PmwCD1GgFF0gHl9nDoF59b93LxuVKfTwAiAWhcdeEqWKvlEzXT7pB46O6TRm91dLJY6lHfpC1/t2Zg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/stb-vorbis@0.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":136081},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"0796d741a41a2afa731ead816f6d2ff8aaa3ae99","scripts":{"lint":"eslint .","build":"npm run test:types && npm run build:wasm","format":"prettier . --write","build:wasm":"tsx scripts/build-wasm.ts","test:types":"npm run lint && tsc -b","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3e21898e-cb73-4a93-8ac0-22715bb39b18"}},"repository":{"url":"git+https://github.com/spessasus/stb-vorbis.git","type":"git"},"_npmVersion":"11.19.0","description":"Synchronous Ogg Vorbis decoder for JavaScript and WebAssembly","directories":{},"_nodeVersion":"26.7.0","allowScripts":{"esbuild@0.28.2":true},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.11","eslint":"^10.8.1","esbuild":"^0.28.2","globals":"^17.9.0","prettier":"^3.9.6","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.2.0","typescript-eslint":"^8.66.0","eslint-plugin-unicorn":"^73.0.0","eslint-config-prettier":"^10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/stb-vorbis_0.0.4_1786306922257_0.6497638073709695","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Only the latest version of stb-vorbis is supported."},"0.0.5":{"name":"stb-vorbis","version":"0.0.5","keywords":["ogg","vorbis","audio","audio-decoder","pcm","stb-vorbis","stb_vorbis","wasm","webassembly","javascript","typescript","audioworklet","audio-worklet","browser"],"author":{"url":"https://github.com/spessasus","name":"spessasus","email":"spesekspesek@gmail.com"},"license":"Apache-2.0","_id":"stb-vorbis@0.0.5","maintainers":[{"name":"spesek","email":"spesekspesek@gmail.com"}],"homepage":"https://github.com/spessasus/stb-vorbis#readme","bugs":{"url":"https://github.com/spessasus/stb-vorbis/issues","email":"spesekspesek@gmail.com"},"dist":{"shasum":"b140bd4139a4a8a84d65faaeda235d67a7455aed","tarball":"https://registry.npmjs.org/stb-vorbis/-/stb-vorbis-0.0.5.tgz","fileCount":5,"integrity":"sha512-XZkvJDA++nsZnOV0b72L7fDP9/F5S2KnynL7zaEH8JojLzlEUXMQPyiIeViKJVF6z7b+GfcvwJN/EbHyWn8Ytw==","signatures":[{"sig":"MEUCIG2/HkO6INf/ykytMxU+RztPvbu8IHV1FfaASYhAqA/XAiEA7rDY/lWkJRKswwB7y72qt51Vtl1ACM8EpHGV/DCjQx0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/stb-vorbis@0.0.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":136478},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"d58b2e92bc4bf3966afaaafffe02b8b2e535ee44","scripts":{"lint":"eslint .","build":"npm run test:types && npm run build:wasm","format":"prettier . --write","build:wasm":"tsx scripts/build-wasm.ts","test:types":"npm run lint && tsc -b","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3e21898e-cb73-4a93-8ac0-22715bb39b18"}},"repository":{"url":"git+https://github.com/spessasus/stb-vorbis.git","type":"git"},"_npmVersion":"11.19.0","description":"Synchronous Ogg Vorbis decoder for JavaScript and WebAssembly","directories":{},"_nodeVersion":"26.7.0","allowScripts":{"esbuild@0.28.2":true},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.11","eslint":"^10.8.1","esbuild":"^0.28.2","globals":"^17.9.0","prettier":"^3.9.6","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.2.0","typescript-eslint":"^8.66.0","eslint-plugin-unicorn":"^73.0.0","eslint-config-prettier":"^10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/stb-vorbis_0.0.5_1786311487767_0.6572413774208152","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Only the latest version of stb-vorbis is supported."},"0.0.6":{"name":"stb-vorbis","version":"0.0.6","keywords":["ogg","vorbis","audio","audio-decoder","pcm","stb-vorbis","stb_vorbis","wasm","webassembly","javascript","typescript","audioworklet","audio-worklet","browser"],"author":{"url":"https://github.com/spessasus","name":"spessasus","email":"spesekspesek@gmail.com"},"license":"Apache-2.0","_id":"stb-vorbis@0.0.6","maintainers":[{"name":"spesek","email":"spesekspesek@gmail.com"}],"homepage":"https://github.com/spessasus/stb-vorbis#readme","bugs":{"url":"https://github.com/spessasus/stb-vorbis/issues","email":"spesekspesek@gmail.com"},"dist":{"shasum":"9425bf7415d8792d1b26742c87247b0ec8207f08","tarball":"https://registry.npmjs.org/stb-vorbis/-/stb-vorbis-0.0.6.tgz","fileCount":5,"integrity":"sha512-CyvjJEGROIdnuZknwFvdOfMIO1ssUxO2OawsXCR3IlbJ8z2IMBjDe8FDxFJqBfLgf1ZOdqvoHAYx3Xk8q9rbbg==","signatures":[{"sig":"MEUCIAIMGvcAuEylrFA2P0YHvvcl7mUScOL7SXh2c7s4yTGmAiEAmFab57uFT4OsMOFGcUfaB3mokFBIX5oLKPO45v5aqwo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/stb-vorbis@0.0.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":130252},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"2c5f11f028192b5580650ffd79d49ca3019a32fb","scripts":{"lint":"eslint .","build":"npm run test:types && npm run build:wasm","format":"prettier . --write","build:wasm":"tsx scripts/build-wasm.ts","test:types":"npm run lint && tsc -b","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3e21898e-cb73-4a93-8ac0-22715bb39b18"}},"repository":{"url":"git+https://github.com/spessasus/stb-vorbis.git","type":"git"},"_npmVersion":"11.19.0","description":"Synchronous Ogg Vorbis decoder for JavaScript and WebAssembly","directories":{},"_nodeVersion":"26.7.0","allowScripts":{"esbuild@0.28.2":true},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.11","eslint":"^10.8.1","esbuild":"^0.28.2","globals":"^17.9.0","prettier":"^3.9.6","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.2.0","typescript-eslint":"^8.66.0","eslint-plugin-unicorn":"^73.0.0","eslint-config-prettier":"^10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/stb-vorbis_0.0.6_1786482938769_0.5064528638274366","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-08-09T20:02:26.323Z","modified":"2026-08-15T21:34:19.945Z","0.0.2":"2026-08-09T20:02:26.528Z","0.0.3":"2026-08-09T20:18:19.975Z","0.0.4":"2026-08-09T20:22:02.403Z","0.0.5":"2026-08-09T21:38:07.923Z","0.0.6":"2026-08-11T21:15:38.915Z"},"bugs":{"url":"https://github.com/spessasus/stb-vorbis/issues","email":"spesekspesek@gmail.com"},"author":{"url":"https://github.com/spessasus","name":"spessasus","email":"spesekspesek@gmail.com"},"license":"Apache-2.0","homepage":"https://github.com/spessasus/stb-vorbis#readme","keywords":["ogg","vorbis","audio","audio-decoder","pcm","stb-vorbis","stb_vorbis","wasm","webassembly","javascript","typescript","audioworklet","audio-worklet","browser"],"repository":{"url":"git+https://github.com/spessasus/stb-vorbis.git","type":"git"},"description":"Synchronous Ogg Vorbis decoder for JavaScript and WebAssembly","maintainers":[{"name":"spesek","email":"spesekspesek@gmail.com"}],"readme":"# stb-vorbis\n\nA small synchronous Vorbis decoder for JavaScript using [`stb_vorbis`](https://github.com/nothings/stb) through WebAssembly.\n\nThis decoder is designed for restricted environments, such as an `AudioWorklet`.\nIt doesn't use `fetch` or any APIs not available in AudioWorklets and provides a fully synchronous decode method, shipping one JS file.\nThe WebAssembly binary is stored as base64-encoded data in the JS file.\n\nMade for use in [`spessasynth_core`](https://github.com/spessasus/spessasynth_core), but can be used separately.\n\n## Installation\n\n```bash\nnpm install stb-vorbis\n```\n\n## Example\n\n```ts\nimport { StbVorbis } from \"stb-vorbis\";\n\n// Initialize the decoder\nawait StbVorbis.ready;\n\nconst ogg = await fetch(\"/audio/example.ogg\").then((response) =>\n    response.arrayBuffer()\n);\n\n// Decode the audio data\nconst audio = StbVorbis.decode(ogg); // f32 by default\n\nconsole.log(audio.sampleRate); // For example: 44100\nconsole.log(audio.channels.length); // Number of channels\nconsole.log(audio.channels[0]); // Float32Array containing channel 1\n```\n\nA proper example can be found in the `examples/` directory. It plays the specified Ogg Vorbis file through ffplay.\nRun it using `tsx`.\n\n## API reference\n\n### ready\n\n```ts\nawait StbVorbis.ready;\n```\n\nResolves when the decoder has been initialized. Call `await StbVorbis.ready` before calling `StbVorbis.decode()`.\n\n### decode\n\n```ts\nStbVorbis.decode(data);\n```\n\nSynchronously decodes a complete Vorbis stream in an Ogg Container.\n\n- `data` - `ArrayBufferLike` or `Uint8Array` - the binary Ogg Vorbis data.\n\nThrows if the decoder has not been initialized, if the input cannot be decoded, or if WASM memory allocation fails.\n\nThe returned object is described below.\n\n### DecodedAudio\n\n```ts\ninterface DecodedAudio {\n    readonly sampleRate: number;\n    readonly channels: Float32Array[];\n}\n```\n\n- `sampleRate` - sample rate in Hz.\n- `channels` - an array of `Float32Array` channel PCM data. All arrays have the same length.\n\n## Building from source\n\nThe build requires Emscripten. The build script looks for `emcc` in this order:\n\n1. The `EMCC` environment variable.\n2. `$EMSDK/upstream/emscripten/emcc`.\n3. `/usr/lib/emscripten/emcc`.\n4. `~/emsdk/upstream/emscripten/emcc`.\n5. `emcc` on `PATH` directly.\n\nFor a custom installation, either activate Emscripten in the shell or set `EMCC` explicitly:\n\n```bash\nEMCC=/path/to/emsdk/upstream/emscripten/emcc npm run build\n```\n\nTo build from source,\nrun:\n\n```\ngit clone https://github.com/spessasus/stb-vorbis\ncd stb-vorbis\nnpm install\nnpm run build\n```\n\nThe final build publishes `dist/index.js`, which contains the code and type declarations.\n\n## License\n\nApache License 2.0.\n\nThe included `stb_vorbis.c` source retains its original public-domain dedication. See the bottom of the file for details.\n\n## Special Thanks\n\n- [nothings/stb](https://github.com/nothings/stb) - for the original C library.\n- [emscripten](https://github.com/emscripten-core/emscripten) - for the WebAssembly compiler.\n","readmeFilename":"README.md"}