pitchBasedCompress
pitchBasedCompress(
audioBuffer,ratio):Promise<AudioBuffer>
Defined in: packages/pleco-xa/src/scripts/compression.js:67
Pitch-based audio compression — a plain linear-interpolation resample kept at the original sample rate, so PITCH AND TEMPO CHANGE TOGETHER (like playing a record at the wrong speed). No anti-aliasing filter is applied. Use tempoBasedCompress for pitch-preserving tempo change.
Parameters
Section titled “Parameters”audioBuffer
Section titled “audioBuffer”AudioBuffer
Input audio buffer
number
Length ratio (0.8 = 20% shorter, faster AND higher-pitched)
Returns
Section titled “Returns”Promise<AudioBuffer>
Compressed audio buffer