Ecasound Audio Processing Above Amplitude Threshold

This article explains how to configure an Ecasound chain to process audio signals that exceed a specific amplitude threshold. While Ecasound lacks a dedicated standalone native "gate" operator out of the box, it fully supports threshold-based processing by integrating LADSPA dynamic plugins and combining chains with envelope-controlled routing. Below, you will learn the exact methods to isolate and apply effects exclusively to loud audio passages using Ecasound.

Using LADSPA Gate Plugins in Chains

The most reliable way to restrict processing to audio above an amplitude threshold is by integrating a LADSPA gate plugin into your Ecasound chain. The SWH LADSPA plugin set includes a standard gate (gate_1410) that suppresses any signal falling below your chosen decibel level.

To apply this, construct an Ecasound command that loads the plugin onto the processing chain:

ecasound -i input.wav -el:gate,-20,10,50,100 -o output.wav

In this setup:

Applying Effects Exclusively Above the Threshold

If you want to apply an effect (such as reverb, distortion, or pitch shifting) only to the audio exceeding the threshold, you place the processing effects after the gate in the chain sequence:

ecasound -i input.wav -el:gate,-18,5,20,50 -efl:1000 -o processed_peaks.wav

Because Ecasound processes operators sequentially from left to right, the gate first strips away all audio beneath -18 dB. The subsequent low-pass filter (-efl:1000) then operates strictly on the audio that passed through the gate.

Parallel Chain Configuration for Dry/Wet Routing

To process only the loud sections of an audio stream while retaining the original audio intact, you can split the input across two interconnected chains:

  1. Chain 1 (Dry): Carries the unaltered input directly to the output.
  2. Chain 2 (Gated Effect): Applies the threshold gate and an effect (e.g., LADSPA plate reverb), passing only the processed peaks.
ecasound \
  -a:1,2 -i input.wav \
  -a:1 -o output.wav \
  -a:2 -el:gate,-15,10,30,80 -pn:plate -a:2 -o output.wav

In this configuration, -a:1,2 -i input.wav feeds the input into both chains simultaneously. Chain 2 isolates the signals exceeding -15 dB, processes them through the plate preset, and mixes the result back into output.wav alongside the dry signal from Chain 1.