tempoBasedCompress
tempoBasedCompress(
audioBuffer,ratio):Promise<AudioBuffer>
Defined in: packages/pleco-xa/src/scripts/compression.js:108
Tempo-based audio compression — PITCH-PRESERVING time stretch via the phase vocoder (src/effects/index.js time_stretch). Each channel is stretched independently; output length is round(input length * ratio) and the dominant pitch is unchanged.
Parameters
Section titled “Parameters”audioBuffer
Section titled “audioBuffer”AudioBuffer
Input audio buffer
number
Length ratio (0.8 = 20% shorter/faster, same pitch)
Returns
Section titled “Returns”Promise<AudioBuffer>
Compressed audio buffer