{"_id":"@audio/decode-wavpack","name":"@audio/decode-wavpack","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@audio/decode-wavpack","version":"1.0.0","description":"Decode WavPack (.wv) audio with libwavpack WASM","type":"module","main":"decode-wavpack.js","types":"decode-wavpack.d.ts","exports":{".":"./decode-wavpack.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.4.0"},"engines":{"node":">=18"},"keywords":["wavpack","wv","hybrid","lossless","audio","decode","decoder","wasm","libwavpack"],"license":"BSD-3-Clause","author":{"name":"audiojs"},"homepage":"https://github.com/audiojs/decode/tree/main/packages/decode-wavpack","repository":{"type":"git","url":"git+https://github.com/audiojs/decode.git","directory":"packages/decode-wavpack"},"bugs":{"url":"https://github.com/audiojs/decode/issues"},"audio":"./audio.js","sideEffects":false,"funding":"https://github.com/sponsors/audiojs","gitHead":"c227363046dc3a0308c95ee112f22795c0ac04ca","_id":"@audio/decode-wavpack@1.0.0","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-yUY2fCABNluzRipAmxGO/FL6MGwx3fZm5RynWtYn2mhBtoqWxa/UycEYLOuZiwgrc8E9u203OeAvBD4E4rlDEw==","shasum":"1421b65e77c1efe348d7838b087402db87c7300d","tarball":"https://registry.npmjs.org/@audio/decode-wavpack/-/decode-wavpack-1.0.0.tgz","fileCount":9,"unpackedSize":65691,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEbGG+deZ48HYiG0veMFbZhoJEPuQqRauTXpaGEUiOlGAiBgkkTzCztpCsUQCcv4HfhhfQIbb+XRGWkqoR7TVd6NZA=="}]},"_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-wavpack_1.0.0_1787957589540_0.13948388608666762"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-28T22:53:09.357Z","1.0.0":"2026-08-28T22:53:09.730Z","modified":"2026-08-28T22:53:10.017Z"},"maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"description":"Decode WavPack (.wv) audio with libwavpack WASM","homepage":"https://github.com/audiojs/decode/tree/main/packages/decode-wavpack","keywords":["wavpack","wv","hybrid","lossless","audio","decode","decoder","wasm","libwavpack"],"repository":{"type":"git","url":"git+https://github.com/audiojs/decode.git","directory":"packages/decode-wavpack"},"author":{"name":"audiojs"},"bugs":{"url":"https://github.com/audiojs/decode/issues"},"license":"BSD-3-Clause","readme":"# @audio/decode-wavpack [![npm](https://img.shields.io/npm/v/@audio/decode-wavpack)](https://www.npmjs.com/package/@audio/decode-wavpack) [![BSD-3-Clause](https://img.shields.io/badge/BSD--3--Clause-%E0%A5%90-white)](https://github.com/krishnized/license)\n\nDecode WavPack (.wv) to PCM float samples\n\n```\nnpm install @audio/decode-wavpack\n```\n\n```js\nimport decode, { decoder } from '@audio/decode-wavpack'\n```\n\n[libwavpack](https://github.com/dbry/WavPack) (the reference WavPack 5 implementation, David Bryant) compiled to a single-file WASM ES module — no side files, loads from any CDN, Node, workers and AudioWorklets. Handles everything the format defines: lossless and hybrid/lossy, 8/16/24/32-bit integer and 32-bit float, mono through multichannel, and DSD-as-PCM (`OPEN_DSD_AS_PCM`, decimated to 24-bit PCM by the library). Streaming decode drives libwavpack's own block reader through a memory-backed `WavpackStreamReader64`, so multichannel block groups and adaptive decorrelation state are handled exactly as the reference library handles them — this package only tracks byte-level block boundaries.\n\n```js\nlet { channelData, sampleRate } = await decode(wvBytes)\n\nlet dec = await decoder()\nlet head = dec.decode(chunk1)   // synchronous; partial blocks carry over\nlet tail = dec.flush()          // drops an incomplete trailing block, if any\ndec.free()\n```\n\n| Export | | |\n|---|---|---|\n| `decode(src)` | `Promise<AudioData>` | Whole-stream decode |\n| `decoder()` | `Promise<{decode, flush, free}>` | Streaming decoder; `decode(chunk)` is synchronous |\n\n`AudioData` is `{ channelData: Float32Array[], sampleRate: number }`, samples in `[-1, 1]`. Integer PCM is scaled by `2^(bits-1)` (asymmetric, matching WAV convention: max positive sample maps to `<1`, max negative to exactly `-1`); float PCM is a direct bit reinterpretation (WavPack stores float samples pre-normalized when opened with `OPEN_NORMALIZE`, which this package always sets). Channels come out in the order libwavpack reports them, which for standard Microsoft-ordered sources (anything ffmpeg or the WavPack CLI produces) is WAV order: FL, FR, FC, LFE, BL, BR, ...\n\n`decode()` drains every sample libwavpack can produce from the blocks fed so far, every call — there's no encoder lookahead or block-spanning delay to hold back, so `flush()` only ever discards an incomplete trailing block (a stream cut off mid-block) and returns nothing new.\n\nHybrid/lossy WavPack (`-b<n>`) decodes at whatever quality it was encoded at; the `.wvc` correction file (lossless-hybrid two-file mode) is not read — only the standalone `.wv` bitstream. A garbage or non-WavPack input throws instead of returning empty/wrong data.\n\n**Use when:** you need a from-scratch, spec-accurate WavPack decoder in the browser or Node — audio tools reading `.wv` files, WavPack-in-container demuxers, or any pipeline that already speaks `@audio`'s `{channelData, sampleRate}` shape.\n\n---\n\nPart of [@audio/decode](https://github.com/audiojs/decode) — the decode family umbrella.\n\n[ॐ](https://github.com/krishnized/license/) · [BSD-3-Clause](./LICENSE), inherited from the bundled [libwavpack](./LICENSE.wavpack).\n","readmeFilename":"README.md","_rev":"1-352b375a4da2d67fd4560678197dcb5b"}