How to Apply Vocoder Effect to Vocals in FFmpeg

This article provides a straightforward, step-by-step guide on how to create a classic robotic vocoder effect using FFmpeg. By combining a modulator track (your vocal recording) and a carrier track (a synthesizer chord or drone), you will learn the exact FFmpeg command-line arguments and filter parameters needed to merge these signals and generate a high-quality vocoded audio output.


Understanding the Vocoder Setup

To create a vocoder effect, you need two distinct audio inputs: 1. The Carrier (Synth): A rich harmonic sound source, such as a synthesizer pad, saw-wave chord, or bright drone. This provides the musical pitch and tone. 2. The Modulator (Vocal): The speech or vocal track. This provides the rhythmic and phonetic characteristics (the words being spoken).

FFmpeg’s built-in vocoder filter requires both inputs to be merged into a single stereo stream first, where one channel acts as the carrier and the other acts as the modulator.


The FFmpeg Command

Below is the standard command to apply the vocoder effect. This command takes a mono synth track and a mono vocal track, merges them into a stereo pair, and applies the vocoder filter.

ffmpeg -i synth.wav -i vocal.wav -filter_complex \
"[0:a][1:a]join=inputs=2:channel_layout=stereo[stereo]; \
 [stereo]vocoder=carrier_channel=0:modulator_channel=1:bands=30:gain=2.0[out]" \
-map "[out]" output.wav

Command Breakdown


Fine-Tuning the Parameters

You can adjust the parameters within the vocoder filter to customize the texture and clarity of the effect: