Time and pitch
Change speed without pitch and pitch without speed, and fit audio to a length.
On this page
Change speed without pitch and pitch without speed, and fit audio to a length.
audioStretch
Change the speed of audio without changing its pitch
audioStretch( audio, rate )
| Argument | Type | Default | |
|---|---|---|---|
audio | any | required | The audio buffer. |
rate | double | required | Speed factor between 0.25 and 4. 1.25 is 25 percent faster and shorter, 0.8 is slower and longer. |
Returns A new audio buffer.
audioFitTo
Change the length of audio to a number of seconds without changing its pitch
audioFitTo( audio, seconds )
| Argument | Type | Default | |
|---|---|---|---|
audio | any | required | The audio buffer. |
seconds | double | required | The length to reach, in seconds. The change in speed should stay within about 25 percent for natural results. |
Returns A new audio buffer of that length.
audioPitch
Change the pitch of audio without changing its length
audioPitch( audio, semitones )
| Argument | Type | Default | |
|---|---|---|---|
audio | any | required | The audio buffer. |
semitones | double | required | Up (positive) or down (negative) in semitones, within 24. 12 is one octave. |
Returns A new audio buffer.