Configure FFmpeg aecho Filter Delay Decay and Feedback
The FFmpeg aecho filter allows you to add a realistic
echo effect to audio streams by controlling the direct and reflected
sound. This guide provides a straightforward explanation of how to
configure the filter’s core parameters—specifically delay time, decay
factor, and simulated feedback—along with practical command-line
examples to get the exact audio effect you need.
Understanding the aecho Syntax
The basic syntax for the aecho filter is:
aecho=in_gain:out_gain:delays:decaysin_gain: Sets the input volume (0.0 to 1.0).out_gain: Sets the output volume (0.0 to 1.0).delays: A list of delay times in milliseconds, separated by the pipe character (|).decays: A list of decay factors (volume drop-offs) corresponding to each delay, separated by the pipe character (|).
Configuring Delay Time
The delay time determines how long it takes (in milliseconds) for the echo to be heard after the original sound.
- To configure a single delay of 1 second (1000 milliseconds):
aecho=0.8:0.8:1000:0.5 - To configure multiple distinct delays (e.g., a short slapback echo
followed by a longer echo), separate the values with a pipe
(
|). For example, 500ms and 1000ms:aecho=0.8:0.8:500|1000:0.5|0.3
Configuring the Decay Factor
The decay factor determines how much quieter each subsequent echo is
compared to the original sound. It is expressed as a decimal between
0.0 (complete silence/no echo) and 1.0 (same
volume as the original sound, which can cause clipping if not
managed).
- A high decay factor like
0.7creates a loud, lingering echo. - A low decay factor like
0.2creates a quick, subtle echo that fades rapidly. - Each delay time mapped in the command must have a corresponding
decay factor. For example, if you have two delays, you must define two
decays:
aecho=0.8:0.8:500|1000:0.6|0.3(The 500ms delay has a 0.6 decay, and the 1000ms delay has a 0.3 decay).
Configuring Feedback
The aecho filter does not have a dedicated “feedback”
parameter like some analog delay pedals. Instead, feedback—the
repetition of echoes fading over time—is achieved by configuring
multiple delay lines with progressively lower decay factors.
To simulate a dense feedback loop where the sound bounces repeatedly, stack multiple delay steps at equal intervals with descending decay values:
ffmpeg -i input.wav -af "aecho=0.8:0.8:250|500|750|1000:0.5|0.25|0.12|0.06" output.wavIn this example, the delay occurs every 250 milliseconds, and the decay factor is halved each time, simulating a natural, decaying feedback tail.