Add Echo Effect to Audio with FFmpeg on Linux
This article provides a quick, practical guide on how to add an echo
or delay effect to audio files using FFmpeg’s powerful audio filters on
Linux. You will learn the core syntax for the aecho filter,
understand what each parameter controls, and see real-world command
examples to achieve the exact sound depth you want.
Understanding the FFmpeg Echo Filter
To create an echo on Linux, FFmpeg utilizes the -af
(audio filter) flag combined with the aecho filter. The
basic anatomy of the echo filter relies on four primary parameters,
structured as follows:
aecho=in_gain:out_gain:delay:decay
Here is what each specific value controls:
in_gain: Controls the input volume of the original sound (e.g.,0.8).out_gain: Controls the overall output volume after the filter is applied (e.g.,0.9).delay: Specifies the time in milliseconds between the original sound and the echo. You can add multiple delays separated by pipes|(e.g.,1000for a 1-second delay).decay: Specifies the volume drop-off for each reflection. Like delays, multiple values are separated by pipes and must match the number of delay arguments (e.g.,0.5).
Common Command Examples
Below are practical commands you can run directly in your Linux terminal.
1. Standard Single Echo
This command adds a distinct, single reflection exactly 400 milliseconds after the original audio, with the reflection volume cut in half.
ffmpeg -i input.mp3 -af "aecho=0.8:0.88:400:0.5" output.mp32. Multi-Echo (Canyon/Robotic Effect)
By chaining multiple delays and decays, you can create a trailing, atmospheric canyon effect. The example below sets two echoes: one at 500ms (at 50% volume) and a second trailing one at 1000ms (at 25% volume).
ffmpeg -i input.wav -af "aecho=0.8:0.9:500|1000:0.5|0.25" output.wav3. Short Subtle Room Delay
If you want to give a vocal or instrument track a bit of space without a harsh, obvious echo, use a shorter delay time. This command creates a tight, 60ms ambient reflection.
ffmpeg -i voice.ogg -af "aecho=0.8:0.8:60:0.3" output.ogg