time_stretch
time_stretch(
y,rate,options?):Float32Array<ArrayBufferLike>
Defined in: packages/pleco-xa/src/effects/index.js:381
Time-stretch an audio series by a fixed rate (pitch-preserving). Pipeline: stft → phase_vocoder → istft with output length round(n / rate).
Parameters
Section titled “Parameters”Float32Array<ArrayBufferLike>
Audio signal
number
Stretch factor (> 1 speeds up, < 1 slows down)
options?
Section titled “options?”STFT parameters
center?
Section titled “center?”boolean = true
hop_length?
Section titled “hop_length?”number = null
Defaults to n_fft/4
n_fft?
Section titled “n_fft?”number = 2048
pad_mode?
Section titled “pad_mode?”string = 'constant'
win_length?
Section titled “win_length?”number = null
window?
Section titled “window?”string = 'hann'
Returns
Section titled “Returns”Float32Array<ArrayBufferLike>
Stretched audio, length round(y.length / rate)
Throws
Section titled “Throws”When rate <= 0