/** * Tempo and pitch manipulation. * * Two distinct operations that are easy to confuse: * * - **`changeSpeed`** resamples. Playing a record faster raises its pitch; this * does the digital equivalent. Cheap, and correct when you want the * "chipmunk" behaviour. * - **`changeTempo`** uses WSOLA (Waveform Similarity Overlap-Add) to change * duration while holding pitch constant — a podcast at 1.5× that still sounds * like the same person. * * WSOLA works by cutting the signal into overlapping windows and reassembling * them at a different spacing. The "waveform similarity" part is what makes it * usable: naively overlapping windows at arbitrary offsets causes phase * cancellation that sounds like flanging or echo, so each window is nudged * within a small search range to the position where it best correlates with the * natural continuation of the previous one. */ /** * Changes playback speed, altering pitch with it. * * @param factor `2` plays twice as fast and an octave higher; `0.5` halves both. */ export declare function changeSpeed(channels: readonly Float32Array[], factor: number): Float32Array[]; /** * Changes duration while preserving pitch. * * @param factor `1.5` makes it 1.5× faster (shorter); `0.5` makes it twice as long. */ export declare function changeTempo(channels: readonly Float32Array[], factor: number, sampleRate: number): Float32Array[]; /** * Shifts pitch without changing duration. * * Implemented as tempo change followed by resampling: stretch the audio, then * play the stretched version at a rate that restores the original length. The * pitch change survives; the duration change cancels out. * * @param semitones Positive raises pitch, negative lowers it. */ export declare function changePitch(channels: readonly Float32Array[], semitones: number, sampleRate: number): Float32Array[];