How to Use the FFmpeg Haas Filter on Mono Audio

This article provides a straightforward guide on using FFmpeg's built-in haas audio filter to widen a mono audio source into a rich, spatial stereo track. You will learn the core concepts behind the Haas effect, the basic command required to apply it, and how to fine-tune specific parameters such as delay and channel gain for optimal stereo separation.


What Is the Haas Effect?

The Haas effect (also known as the precedence effect) is a psychoacoustic phenomenon where a listener perceives spatial depth and width when two identical audio signals are played with a slight time delay between the left and right channels—typically between 1 and 35 milliseconds. By delaying one channel slightly, the brain interprets the sound as coming from a wider physical space rather than a single pinpoint source.

Basic Command

FFmpeg includes a dedicated haas filter that automatically turns an audio track into a widened stereo field. Even if your source file is mono, FFmpeg will process it into a two-channel stereo output.

Run the following command to apply the default Haas filter settings:

ffmpeg -i input_mono.wav -af "haas" output_stereo.wav

Customizing Filter Parameters

The haas filter allows you to manually adjust delay times, gains, and phase options to control the intensity and width of the stereo image.

Key parameters include:

  • left_delay: Sets the delay in milliseconds applied to the left channel (default is 2.05).
  • right_delay: Sets the delay in milliseconds applied to the right channel (default is 2.12).
  • side_gain: Sets the gain of the side (difference) signal (default is 1).
  • middle_source: Determines the source for the mid (center) signal, such as left, right, or mid (average).
  • left_gain / right_gain: Sets individual channel volume levels.

Example: Stronger Stereo Separation

To create a more noticeable stereo separation, you can leave one channel undelayed while delaying the opposite channel by 15 to 25 milliseconds:

ffmpeg -i input_mono.wav -af "haas=left_delay=0:right_delay=20:side_gain=0.8" output_stereo.wav

In this command:

  • left_delay=0 keeps the left channel playing immediately.
  • right_delay=20 introduces a 20 ms delay to the right channel, shifting perceived localization and widening the sound.
  • side_gain=0.8 slightly lowers the difference signal to prevent excessive phase issues.

Checking Mono Compatibility

While the Haas effect creates a wide stereo image, combining delayed channels back into mono can cause phase cancellation (comb filtering), making the sound thin or hollow. After applying the haas filter, verify your mix by testing how it sounds summed back to mono:

ffmpeg -i output_stereo.wav -af "pan=mono|c0=0.5*c0+0.5*c1" mono_test.wav

If the mono test sounds hollow, reduce the delay parameters or lower the side_gain in your initial haas filter configuration.