How a real-time voice changer works

Three hands-on explainers: why a higher pitch alone does not make a new voice, how audio is pitch-shifted without speeding it up, and where the milliseconds of delay come from.

Source and filter

Speech scientists describe the voice as a source (the vocal folds buzzing at your pitch, roughly 85–155 Hz for adult men and 165–255 Hz for adult women) and a filter (your throat, mouth and nose, whose shape creates resonant peaks called formants). Vowels are formant patterns: "ee" has a low first formant and a high second one, "ah" the reverse.

This is why the girl voice preset does more than shift pitch: it also cuts the low shelf and brightens the top to imply a smaller vocal tract. A true formant shifter needs spectral analysis that adds latency, so live voice changers approximate it with EQ.

Two heads, one crossfade

Video editors change pitch by resampling a whole file. Live, that is impossible, because the audio you would need has not happened yet. The delay-line shifter keeps a short loop of recent sound and reads it back slightly faster (pitch up) or slower (pitch down). When a read head drifts a full window away, it must jump; a second head half a window behind covers the jump while the first fades out.

The Grain knob in the rack is that window. Short windows track fast speech but sound buzzy on big downward shifts; long windows sound smoother but smear consonants. Presets choose it for you: 20 ms for helium, 60 ms for demon.

Watching a read head chase the write head teaches more than a paragraph of theory ever could; ahaboo brings that same watch-it-move approach to why the Moon waxes and wanes.

The latency budget

The Web Audio API processes sound in blocks of 128 samples (2.7 ms at 48 kHz). The browser adds input and output buffers on top, which is why VoiceFX asks for the "interactive" latency hint. The pitch shifter's average delay is about half its window. After that come devices you choose: a virtual cable adds a few milliseconds, a Bluetooth headset adds 150–250 ms because of its codec buffer.

What matters for comfort is the delay to your own ears when monitoring. Delayed auditory feedback studies show speakers start to stumble as self-monitoring delay grows toward 100–200 ms. Your friends on Discord cannot tell the difference between 20 ms and 40 ms, because the call adds far more.

The rest of the pedalboard

PedalWhat it doesUsed in
GateMutes the mic below a threshold so fans and keyboards drop out between words.Broadcast, Walkie-Talkie
TuneDetects pitch (YIN autocorrelation) and steers it to the nearest note in a scale.Autotune
RingMultiplies the voice by a sine wave, creating metallic, inharmonic tones.Robot, Alien
VocoderSixteen band-pass filters follow your voice and play the result on a sawtooth synth.Vocoder, Android
CrushReduces bit depth and sample rate for lo-fi, 8-bit crunch.8-Bit, Glitch
ToneHigh/low-cut filters and three-band EQ; a 300–3400 Hz band makes a telephone.Telephone, Megaphone
DriveSoft-clipping distortion that adds grit and loudness.Demon, Rock Mic
ModChorus (a wobbling short delay) and tremolo (volume wobble).Ghost, Underwater
Echo / ReverbDiscrete repeats, and a convolution with a generated room response.Echo, Reverb

Questions

How does a real-time voice changer work?

It captures microphone audio in tiny blocks (128 samples, under 3 ms, in the Web Audio API), runs each block through a chain of effects such as pitch shifting, filtering and reverb, and plays the result immediately, faster than you speak.

Why do pitch-shifted voices sound like chipmunks?

Plain pitch shifting moves both the pitch and the resonances (formants) of your vocal tract. Real voices of different people differ in both, but separately. Moving them together makes a voice sound like a sped-up recording rather than a different person.

What is latency in a voice changer?

The delay between speaking and hearing the changed voice. It is the sum of audio buffers, the effect's own processing window and your output device. Under about 30 ms feels instant.

What is the difference between a vocoder and autotune?

Autotune measures your pitch and nudges it to the nearest note. A vocoder discards your pitch entirely, keeping only the loudness of each frequency band, and replays it on a synthesizer.