{"_id":"@audio/shift-wsola","_rev":"4-ca5d512ff25503eb8d2d523fc2afb7fe","name":"@audio/shift-wsola","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@audio/shift-wsola","version":"1.0.0","keywords":["audio","pitch-shift","wsola","overlap-add","dsp"],"author":{"name":"audiojs"},"license":"MIT","_id":"@audio/shift-wsola@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/shift/tree/main/packages/shift-wsola#readme","bugs":{"url":"https://github.com/audiojs/shift/issues"},"dist":{"shasum":"7ddbe0cfee7bf99f99560255a1ba6e7685cc5896","tarball":"https://registry.npmjs.org/@audio/shift-wsola/-/shift-wsola-1.0.0.tgz","fileCount":2,"integrity":"sha512-jOeTSxm/Wt5Sdkg+tF38RqJCb4qx+eSuYqCgbt23B5dAgSr47W/kKxW29mBgQ8I7t5LKAKvBKv+vczC5IQeFew==","signatures":[{"sig":"MEYCIQDFlTJSfD4X8qR3LE60EvRmLQU+sHYl5w544JgX10lP8wIhAP7kkeBrL55ZwvdZYTG0KSIfZXLgYDwNutSbDx4DAU0S","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1723},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./package.json":"./package.json"},"gitHead":"96f567467fac25424e0745397b88595052400a74","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/shift.git","type":"git","directory":"packages/shift-wsola"},"_npmVersion":"11.12.1","description":"WSOLA (Waveform-Similarity Overlap-Add) pitch shift — similarity-search OLA variant","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"time-stretch":"^1.2.1","@audio/shift-core":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/shift-wsola_1.0.0_1783540135994_0.15820865940228868","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@audio/shift-wsola","version":"1.0.1","keywords":["audio","pitch-shift","wsola","overlap-add","dsp"],"author":{"name":"audiojs"},"license":"MIT","_id":"@audio/shift-wsola@1.0.1","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/shift/tree/main/packages/shift-wsola#readme","bugs":{"url":"https://github.com/audiojs/shift/issues"},"dist":{"shasum":"cc7cf40fc706ad0a11bf9c4c300523c9485b8dd4","tarball":"https://registry.npmjs.org/@audio/shift-wsola/-/shift-wsola-1.0.1.tgz","fileCount":3,"integrity":"sha512-d6bdfPmrKPKPNxpsiOd39QYXm6VM9mKooMHUQr1Esy/44xHJJgqABJmB8hecyCA5RkVjCDT9f+LtIYaa16kRZg==","signatures":[{"sig":"MEUCIQCnCV4fH4oMzyIxl8bGm/AdqY3YvHt3SU9Gy7BsPh7p5QIgTt0KYMhFL5uFSOZpVwZJo4aGAwfZReUhixVOn0Lmbl4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6083},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./package.json":"./package.json"},"gitHead":"d2c732642b33df6811872e2d21713bd6a9ab6b75","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/shift.git","type":"git","directory":"packages/shift-wsola"},"_npmVersion":"11.12.1","description":"WSOLA (Waveform-Similarity Overlap-Add) pitch shift — similarity-search OLA variant","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"time-stretch":"^1.2.1","@audio/resample-sinc":"^1.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/shift-wsola_1.0.1_1783624361098_0.18287336154568523","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@audio/shift-wsola","version":"1.0.2","keywords":["audio","pitch-shift","wsola","overlap-add","dsp"],"author":{"name":"audiojs"},"license":"MIT","_id":"@audio/shift-wsola@1.0.2","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/shift/tree/main/packages/shift-wsola#readme","bugs":{"url":"https://github.com/audiojs/shift/issues"},"dist":{"shasum":"31a5a1200dd5494b93abd996a3c3cee76e28a885","tarball":"https://registry.npmjs.org/@audio/shift-wsola/-/shift-wsola-1.0.2.tgz","fileCount":3,"integrity":"sha512-VYNqPxMY1392ItQtb13e6IqhOT5wPHUIaME/dBZ5lwao4aDAroW7Gk93kOnc+uLfZ6oBS1srzHj4Wv1rukDFzA==","signatures":[{"sig":"MEYCIQDYS40mgV5KLt8eATUzRjimTMguHng7DtUBFw8e9/puRwIhAOEoEBt94I2Y83VjxCgtAi2GU3unnJ3/0FVu1WaZYS4R","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6086},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./package.json":"./package.json"},"gitHead":"a37dce02fabb8640a305fd623c7a9f86132e54d0","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/shift.git","type":"git","directory":"packages/shift-wsola"},"_npmVersion":"11.12.1","description":"WSOLA (Waveform-Similarity Overlap-Add) pitch shift — similarity-search OLA variant","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/resample-sinc":"^1.1.0","@audio/stretch-wsola":"^1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/shift-wsola_1.0.2_1783630722044_0.1393911339464724","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@audio/shift-wsola","version":"1.0.3","description":"WSOLA (Waveform-Similarity Overlap-Add) pitch shift — similarity-search OLA variant","type":"module","sideEffects":false,"main":"index.js","exports":{".":"./index.js","./package.json":"./package.json"},"dependencies":{"@audio/stretch-wsola":"^1.0.1","@audio/resample-sinc":"^1.1.0"},"publishConfig":{"access":"public"},"license":"MIT","author":{"name":"audiojs"},"homepage":"https://github.com/audiojs/shift/tree/main/packages/shift-wsola#readme","repository":{"type":"git","url":"git+https://github.com/audiojs/shift.git","directory":"packages/shift-wsola"},"keywords":["audio","pitch-shift","wsola","overlap-add","dsp"],"engines":{"node":">=18"},"funding":"https://github.com/sponsors/audiojs","types":"index.d.ts","gitHead":"d637ae35b709957d2b7dac2266c480efa50dca95","_id":"@audio/shift-wsola@1.0.3","bugs":{"url":"https://github.com/audiojs/shift/issues"},"_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-QY4krRbENqU9YiTs6fh+yBMk8taoD/oaoK2e1Ajg20dpEEQTfzn8VKXNyqOkEPoAbbWynBGZJo2yoWV1+vzqsA==","shasum":"13953250f9d3d412632eea384babb3624dbeffe9","tarball":"https://registry.npmjs.org/@audio/shift-wsola/-/shift-wsola-1.0.3.tgz","fileCount":5,"unpackedSize":9907,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDVQspfp+5SZOGyUtC83aN91S7SG//j8y0rzt30nL92lAIgXgjiojaqTyw1pM231gOFGKUDIm02kDnOIiGQw92obiI="}]},"_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/shift-wsola_1.0.3_1783731806297_0.6825768871078217"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-08T19:48:55.846Z","modified":"2026-07-11T01:03:26.579Z","1.0.0":"2026-07-08T19:48:56.128Z","1.0.1":"2026-07-09T19:12:41.213Z","1.0.2":"2026-07-09T20:58:42.181Z","1.0.3":"2026-07-11T01:03:26.443Z"},"bugs":{"url":"https://github.com/audiojs/shift/issues"},"author":{"name":"audiojs"},"license":"MIT","homepage":"https://github.com/audiojs/shift/tree/main/packages/shift-wsola#readme","keywords":["audio","pitch-shift","wsola","overlap-add","dsp"],"repository":{"type":"git","url":"git+https://github.com/audiojs/shift.git","directory":"packages/shift-wsola"},"description":"WSOLA (Waveform-Similarity Overlap-Add) pitch shift — similarity-search OLA variant","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"readme":"# @audio/shift-wsola [![npm](https://img.shields.io/npm/v/@audio/shift-wsola)](https://www.npmjs.com/package/@audio/shift-wsola) [![MIT](https://img.shields.io/badge/MIT-%E0%A5%90-white)](https://github.com/krishnized/license)\n\nWSOLA (Waveform-Similarity Overlap-Add) pitch shift — similarity-search OLA variant\n\n```\nnpm install @audio/shift-wsola\n```\n\n```js\nimport wsola from '@audio/shift-wsola'\n```\n\nWSOLA time-stretch + sinc resample. Searches each grain position ±`tolerance` samples for maximum cross-correlation with the previous grain's tail, eliminating phase cancellation before resampling to the target pitch.\n\n```js\nwsola(audio, { ratio: 0.85 })\nwsola(audio, { ratio: 1.5, tolerance: 512 })\n```\n\n| Param | Default | |\n|---|---|---|\n| `tolerance` | `frameSize/4` | Similarity search radius (±samples) |\n\n**Preserves** local waveform shape, attack envelopes.<br>\n**Destroys** formants (shifted by resample), phase coherence across long spans.\n\n| f0 err | THD% | alias | attack corr | formant dist | phase coh | shift |\n|-------:|-----:|------:|------------:|-------------:|----------:|------:|\n| 1.67 | 0.1 | 0.005 | 0.995 | 2.358 | 0.864 | 1.674 |\n\nf0 err 1.67 Hz from sinc resample quantization (time-domain algorithms round the stretch ratio to grain boundaries). Attack corr 0.995 ties `delay` for second place — only `hpss`'s untouched percussive pass-through scores higher.\n\n**Use when:** Speech, low-latency, anywhere the phase vocoder's frame latency is unacceptable.<br>\n**Not for:** Polyphonic music with sustained tones.\n\n## Stream\n\n```js\nlet write = wsola({ ratio: 1.5 })\nlet out = write(inputBlock)\nlet tail = write()  // flush\n```\n\n`wsola` buffers the whole input; `write(chunk)` accumulates and the batch algorithm runs once on `write()` (flush, no argument), returning everything at once.\n\n## Data\n\nInput is a `Float32Array` (mono) or an array of `Float32Array` channels (`[left, right, ...]`) — anything else throws `TypeError`. `ratio` here is a fixed number for the whole call — a function or `Float32Array` throws.\n\n---\n\nPart of [@audio/shift](https://github.com/audiojs/shift) — the shift family umbrella. This README is generated from the umbrella docs.\n\nMIT © [audiojs](https://github.com/audiojs)\n","readmeFilename":"README.md"}