Time stretching

On this page 7

Time stretching is the audio process that changes the duration or tempo of a recording without changing its pitch. Among audio effects it is the counterpart of pitch shifting: one alters time while keeping pitch, the other alters pitch while keeping time, and both rely on the same family of algorithms.

Simply playing a recording faster or slower changes speed and pitch together, as with tape or vinyl. Time stretching decouples the two by analyzing the signal and rebuilding it with more or fewer repetitions of its short-term content, which is why it is central to tempo matching, beat editing, dialogue fitting and sound design.

How time stretching works

All practical methods cut the audio into short overlapping segments, typically a few milliseconds to around 100 ms long, and then reassemble them at a different spacing. Stretching repeats or spreads the content; compressing in time skips or overlaps more of it. The challenge is to join the segments without audible clicks, phasing or smearing.

Time-domain methods such as overlap-add and its improved variant WSOLA find the best alignment between neighboring segments by waveform similarity, which works well for speech and monophonic material. Frequency-domain methods, chiefly the phase vocoder, analyze the signal with a short-time Fourier transform, adjust the phase of each frequency bin to the new time grid and resynthesize it, which handles complex polyphonic material better.

The main algorithm families are compared in the following table.

MethodPrincipleBest suited forTypical artifacts
Overlap-add (OLA, WSOLA)Splices waveform segmentsSpeech, single voicesDoubling, stutter on chords
Phase vocoderAdjusts phase per frequency binPads, polyphonic musicPhasiness, smeared transients
GranularRearranges small grainsSound design, texturesGraininess, metallic tone
Transient-preserving hybridsSplits transients from tonal partsMixed music, drumsFewer, but still at extremes
Slice-basedCuts at beats and moves slicesDrum loopsGaps or tails between hits
Time stretching algorithm families

Stretch ratios and quality ranges

Quality depends strongly on the stretch ratio. Small changes are nearly transparent with modern algorithms, while extreme ratios become a creative effect rather than a correction. A useful rule is that the further from 1.0, the more the material type matters.

Tempo changeStretch ratioTypical result
Within about 5 percent0.95 to 1.05Usually transparent on most material
5 to 15 percentAbout 0.85 to 1.15Good on suitable material, audible on dense mixes
15 to 50 percentAbout 0.67 to 1.5Noticeable artifacts, careful algorithm choice
Double or half speed2.0 or 0.5Clearly processed sound
Extreme stretching10 or moreAmbient textures, sound design
Typical outcomes by stretch ratio

Two parameters control the character of most algorithms. The window or grain size sets the time-frequency trade-off: long windows give clean, stable tones but smear transients, while short windows keep attacks sharp but make sustained tones rough. Transient detection marks attacks so that they are copied rather than stretched, preserving the punch of drums and plucked notes.

Time stretching belongs to a group of time and pitch manipulation tools that share algorithms but serve different purposes.

EffectChanges durationChanges pitch
Time stretchingYesNo
Pitch shiftingNoYes
Varispeed or resamplingYesYes, together
Pitch correctionNoYes, selectively per note
Formant shiftingNoChanges vocal character only
Time stretching and neighboring effects

Pitch shifting is often implemented as time stretching followed by resampling: the audio is stretched by the desired ratio and then played back at a correspondingly different rate, restoring the original duration at a new pitch. This explains why the two effects show the same artifacts at similar ratios.

Using time stretching in production

Workstations expose time stretching through elastic audio or warping modes, where markers placed on beats can be moved to a grid, and the audio between them is stretched accordingly. Choosing the mode that matches the material is the most important practical decision.

MaterialRecommended modeReason
Drum loopsSlice or transient-basedKeeps hits sharp, adjusts gaps
Solo vocals and speechMonophonic or time-domainNatural voice, few phasing artifacts
Full mixesHigh-quality hybrid or phase vocoderHandles dense polyphony
Pads and texturesPhase vocoder or granularSmooth sustained tones
Dialogue for pictureSpeech-optimized, small ratiosFits timing invisibly
Choosing a stretch approach by material

Typical tasks include matching the tempo of samples to a project, tightening a live drum performance, fitting a radio commercial to an exact length, aligning overdubs and creating DJ mixes in which tracks with different tempos play together. Offline rendering with the highest-quality algorithm is preferable to real-time processing when CPU allows it.

Artifacts and common mistakes

Most problems come from asking one algorithm to do everything. A setting that sounds perfect on a vocal can blur a drum kit, and stacking several stretch operations multiplies artifacts.

  • Transient smearing makes drums soft and distant; switch to a transient-preserving or slice mode.
  • Phasiness and a hollow, metallic sound are typical of phase vocoders at large ratios.
  • Doubled or stuttering attacks appear in time-domain methods on complex material.
  • Repeated processing degrades quality; always stretch from the original file rather than an already stretched copy.
  • Stereo image shifts can occur when channels are processed independently; use linked stereo processing.

In plain words

Time stretching makes a recording longer or shorter without making voices sound like chipmunks or giants. A song can be slowed down for practice or sped up to match another song, and the notes stay in the same key.

It works by cutting the sound into tiny pieces and repeating or dropping some of them very carefully. Small changes are almost impossible to hear, while big changes start to sound strange, which some musicians use on purpose as an effect.

A real-world example

A radio production studio receives a finished commercial that runs 31.4 seconds, but the station slot is exactly 30 seconds. Rather than re-recording the voice actor, the engineer applies a speech-optimized time stretching algorithm to the whole spot, compressing it by about 4.5 percent.

Because the ratio is small and the algorithm is designed for speech, the voice keeps its natural pitch and tone, and the music bed is stretched separately with a polyphonic mode before the two are remixed. The client hears no difference except that the spot now fits the slot precisely, and the change takes minutes instead of a new recording session.