@audio/ stretch-psola
Status calibrated
npm1.2.3licenseMIT
Pitch-Synchronous Overlap-Add — time-domain stretch for speech and monophonic instruments
Overview
- Install
- Updated
- Family
- stretch, 10 packages under it
- Tags
- time & pitch
Pitch-Synchronous Overlap-Add. Detects pitch period via autocorrelation, windows grains at pitch-cycle boundaries, then re-spaces them — no phase discontinuities at overlaps.
import psola from '@audio/stretch-psola'
psola(data, { factor: 1.5 })
psola(data, { factor: 2, minFreq: 100, maxFreq: 400 }) // male voice range
| Param | Default | |
|---|---|---|
factor |
1 |
Time stretch ratio |
sampleRate |
44100 |
For pitch detection range |
minFreq |
80 |
Lowest expected pitch (Hz) |
maxFreq |
500 |
Highest expected pitch (Hz) |
Falls through to WSOLA on unvoiced/polyphonic frames (autocorrelation peak < 0.72).
Use when: speech, solo vocals, monophonic instruments, factors 0.5–2×.
Not for: polyphonic material, extreme ratios (>2× causes gaps).
Part of @audio/stretch.
License
MIT · ॐ