Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for a way to normalize the sound in MANY MP3 files I have. Some have low sound, while others are louder so I have to turn the volume up or down depending on the song. What ways are there to do this for all files. I specially would like to do it via the terminal but GUI ways are also accepted.

share|improve this question
For normalizing while playing see:…. This will however not change your mp3 file content - may be of advantage ;) – Takkat Jan 22 '13 at 18:09
Not while playing, don't want to have to set it everytime or have a player set the normalize every time I want to listen to the songs. For example, let us say I want to copy the songs to an ipod shuffle or to a pen drive to listen in a mp3 capable player. – Luis Alvarado Jan 22 '13 at 18:13
@Takkat BTW nicely done in that other question. Good information. – Luis Alvarado Jan 22 '13 at 18:24
My wife just tested the Audacity method, and it worked perfectly! Recommended. Please, when people ask for advice it is because they are NOT experts. So don´t tell them to use command line tools when they can do the job with easy-to-understand graphical tools like Audacity. Telling new Linux users to open terminal and run command line tools will just scare them away from Ubuntu, with a feeling that Windows is simple, Linux is difficult. It is not a surprise that DOS is dead, but Windows is alive. – user297240 Jun 23 '14 at 20:42
Scaring away users who find typing words into a "command prompt" too difficult has no downsides. – rupert Apr 15 at 0:41
up vote 10 down vote accepted

Audacity Install audacity

With Audacity we can easily batch process files to apply conversions or effects to many files in a list. To do so we first have to define a "Chain" containing the effects we want to apply.

This is done with "File --> Edit Chains...". In the now opening window press the Add button on the bottom left to insert a new chain (give it a sensible name):

enter image description here

Then choose the effect and it's parameters to insert to the chain (here shown for default values and the Normalize effect).

Important: we always need to also add the effect "Export MP3" (or any other export format) for saving the resulting conversion to disk.

When done leave this window with OK to open "File --> Apply Chain...". Select the Chain we have just created and load all files you need with "Apply to files...". Several files can be selected from the file chooser that opens.

enter image description here

Processed files will be saved in a new subdirectory "cleaned" in the original's path.

Sox Install sox

From version > 14.3 we can use the sox filter --norm for normalizing audio on the command line or for batch processing:

sox --norm infile outfile

MP3-support is added to Sox with libsox-fmt-all Install libsox-fmt-all.

share|improve this answer
Do these tools decode and re-encode? – qed Oct 29 '14 at 21:59
You can't normalize without re-encoding, at least the levels... – Takkat Oct 29 '14 at 22:03
For non-destructive live-normalizing using LADSPA and pulseaudio see… – Takkat Oct 29 '14 at 22:08

Take a look @ mp3gain which for me is even better than normalize-audio

mp3gain -r *.mp3

another useful version could be the -c which prevent to ask if you want to do the changes for many files:

mp3gain -c -r *.mp3

as said in the man page:

mp3gain does not just do peak normalization, as many normalizers do. Instead, it does some statistical analysis to determine how loud the file actually sounds to the human ear. Also, the changes mp3gain makes are completely lossless. There is no quality lost in the change because the program adjusts the mp3 file directly, without decoding and re-encoding.

Note: That package was removed on purpose on ubuntu 15.04. Debian proposes python-rgain as replacement.

share|improve this answer
Also, if you don't want to use the terminal, there is a GUI available for it named easymp3gain-gtk, which makes it very handy! – gilberto.agostinho.f Nov 12 '14 at 21:26
This is super useful. I was very impressed by the quality of normalization using MP3Gain's Windows GUI, so I was glad to find this answer when I needed a Linux command line solution. Would definitely recommend to others. – alexpmil Feb 5 '15 at 18:05
Could you please add some information on how to install it? It doesn't come with Ubuntu by default, and I can't find the package. – Błażej Michalik May 3 at 17:36
@BłażejMichalik done... – Philippe Gachoud May 4 at 7:20

I would use this project Normalize, it's a command-line tool for normalizing audio files. Looks to be exactly what you need. Can do batch processing and doesn't require resampling to intermediate formats.

It's in the package repos as normalize-audio, sudo apt-get install normalize-audio. This is a build maintained upstream by Debian so it should be in anything LTS or newer and is built with mp3 compatibility (tested). There is a good manpage man normalize-audio to explore the options but the commands defaults appear to work well. For batch processing (normalize volume across multiple files), normalize-audio -b *.mp3 or specify individual filenames instead of using wildcards.

share|improve this answer
The OP wants instructions for doing this. Can you provide those? – Seth Jan 22 '13 at 18:13
@iSeth I was initially incorrect about the source only comment because I couldn't find it with apt-cache search. I've updated with details about the deb package. – sean_m Jan 23 '13 at 8:23

For the sake of it, I'll throw my 2 cents in. I was looking for exactly the same thing (only for ogg files) and started a thread at Crunchbang Forum. You can view it here: Normalize-audio can't find mp3 decoder

Basically my solution was the script in post #8. It works for mp3, flac, and ogg input files, possibly others but definitely not wav.

Just create a file (name it whatever you want, I called mine db_adjust_mp3), chmod +x , and stick it in your ~/bin folder. It fills in any missing codec data as well. Example:

Original file: 16._This_Protector.mp3: Audio file with ID3 version 2.3.0, contains:


Normalized file: 16._This_Protector.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, JntStereo

I've modified the script to use normalize-mp3 here so you can use it if you want:


find "$1" -iname "*.""$2" > $HOME/file_list

cat $HOME/file_list | while read line; do
#  echo "$line"
  orig_gain="$(normalize-mp3 -n "$line" | cut -d 'd' -f1)"
  larger=$(echo "$orig_gain"'>'-12 | bc)
  if [[ larger ]]
      gain_difference=$(echo "$orig_gain"*-1-12 | bc)
      gain_difference=$(echo "$orig_gain"-12 | bc)
  echo "Gain Difference will be: $gain_difference""db"
  normalize-ogg --mp3 --bitrate "$3" -g "$gain_difference""db" -v "$line"

This script calculates the difference between the current db level and -12db, then applies a gain adjustment to put the gain at exactly -12db, which is what I've found works the best for me. It is recursive as well, which makes it great for doing entire music collections or files in many subfolders. If you wish to set a different db level, just change the both instances of the number "12" to whatever db level you would like to use. As I posted in my Crunchbang thread, usage is as follows:

normalize-mp3 <directory> <file extenstion(with no leading dot)> <bitrate>

However, when I used to keep my music library in mp3 format, I used to use mp3gain as well, just as Philippe suggested. The dead simplicity of it is great and I really liked it. The problem with normalize-audio though is that it does decode an re-endcode the files, so there is some sound degradation. But unless you're an audiophile and your mp3's are encoded at a high bitrate you shouldn't notice much difference.

The thing I noticed with mp3gain though was that no matter what options I tried I couldn't get everything in my collection to be exactly the same db level, which is what I want so that I never have to adjust the volume from one track to the next. This script does exactly that. Sorry for being so long winded. Hope this helps.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.