How to normalize sound in mp3 files
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 the python-rgain
package as replacement (The advantage is that 'replaygain' supports several file formats, namely Ogg Vorbis , Flac, WavPack and MP3. Also, it allows you to view existing Replay Gain information in any of those file types). After installing it, run replaygain
.
To install python-rgain from the terminal, run the command
sudo apt-get install python-rgain
Alternatively, get the .deb
file for 14.04 (the latest) from here. Install as usual. After that, you need to run sudo apt-get -f install
to correct some dependencies issues.
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):
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.
Processed files will be saved in a new subdirectory "cleaned" in the original's path.
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:
sudo apt install sox libsox-fmt-all
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.