Adjusting Volume with Ecasound -ea Operator
The -ea (envelope amplify) operator in Ecasound is the
standard effect used to control the gain and volume levels of an audio
stream. This article explains how the -ea operator
functions using percentage-based amplitude scaling, how those
percentages correlate directly to decibels (dB), and how to calculate
precise volume increases or reductions in your command-line audio
workflows.
Understanding the
-ea Operator Syntax
In Ecasound, the amplify operator uses the following basic syntax:
-ea:amplify%
The parameter amplify% represents a linear amplitude
percentage applied to the audio signal. It does not accept direct
decibel suffixes (such as +3dB or -6dB);
instead, it expects a numeric value where:
- 100 represents 100% volume, meaning unity gain (no change, or 0 dB).
- Values greater than 100 increase the amplitude (boosting the signal).
- Values between 0 and 100 decrease the amplitude (attenuating the signal).
- 0 completely mutes the signal.
How Percentage Relates to Decibels
Because decibels use a logarithmic scale and -ea
operates on a linear percentage scale, you must convert decibels to a
linear ratio to make precise dB adjustments.
The mathematical formula to convert a target gain in decibels to the Ecasound percentage value is:
\[\text{amplify\%} = 100 \times 10^{\frac{\text{dB}}{20}}\]
Common Decibel-to-Percentage Conversions
- +12 dB:
100 * 10^(12/20)≈ 398% (approaching 4x amplitude) - +6 dB:
100 * 10^(6/20)≈ 200% (double amplitude) - +3 dB:
100 * 10^(3/20)≈ 141% - 0 dB:
100 * 10^(0/20)= 100% (unity gain) - -3 dB:
100 * 10^(-3/20)≈ 71% - -6 dB:
100 * 10^(-6/20)≈ 50% (half amplitude) - -12 dB:
100 * 10^(-12/20)≈ 25% (quarter amplitude) - -20 dB:
100 * 10^(-20/20)= 10%
Practical Usage Examples
Reducing Volume by 6 dB (Half Volume)
To attenuate a file by approximately 6 dB, set the operator to 50%:
ecasound -i input.wav -ea:50 -o output.wavBoosting Volume by 6 dB (Double Volume)
To boost a quiet file by 6 dB, double the amplitude using 200%:
ecasound -i input.wav -ea:200 -o output.wavReal-Time Monitoring with Gain Adjustments
You can chain -ea into real-time audio playback chains,
for example lowering the playback volume by roughly 3 dB:
ecasound -i track.flac -ea:71 -o alsaConsiderations When Boosting Levels
When applying values above 100 to boost audio, monitor
your signal levels to prevent digital clipping. If the amplified signal
exceeds 0 dBFS (full scale), integer-based formats will distort. If
large boosts are necessary, consider pairing -ea with a
limiter or peak-level analyzer within your Ecasound chain.