Configure Haas Filter Delay and Balance in FFmpeg

This article explains how to configure the delay and channel balance of the haas filter in FFmpeg to create a realistic stereo widening effect. The Haas effect (or precedence effect) is a psychoacoustic phenomenon where listeners perceive the spatial position of a sound based on the first arriving wavefront, even if a delayed version comes from a different direction. By adjusting the delay and balance parameters in FFmpeg, you can transform flat, mono audio tracks into rich, spacious stereo mixes.

The Haas Filter Syntax

In FFmpeg, the haas filter uses the following basic syntax:

-af "haas=level_in:level_out:delay1:delay2:balance1:balance2"

You can also use named parameters for clarity:

-af "haas=level_in=1.0:level_out=1.0:delay1=0:delay2=15:balance1=-0.5:balance2=0.5"

Parameter Breakdown


Configuring Delay

To achieve the Haas effect, one channel must be slightly delayed relative to the other. The human brain perceives a sound as coming from a single source with spatial depth when the delay between the left and right ears is between 10 to 30 milliseconds.

Example: Left Channel Dry, Right Channel Delayed (15ms)

To keep the left channel instantaneous and delay the right channel by 15 milliseconds, use:

ffmpeg -i input.wav -af "haas=delay1=0:delay2=15" output.wav

Configuring Channel Balance

Because the delayed channel can sound quieter or “heavy” on one side due to the psychoacoustic precedence effect, you must configure the balance parameters to restore a center image.

Example: Centering the Stereo Image

To counter-balance a 20ms delay on the right channel, you can pan the delayed signal slightly back toward the opposite side to stabilize the stereo image:

ffmpeg -i input.wav -af "haas=delay1=0:delay2=20:balance1=1.0:balance2=-0.3" output.wav

Example: Extreme Stereo Widening

For maximum stereo width, pan both signals hard to their respective sides while applying a 12ms delay to one:

ffmpeg -i input.wav -af "haas=delay1=0:delay2=12:balance1=-1.0:balance2=1.0" output.wav