1

Backstory:

I have about 400 odd songs that I use for background music in my wikipedia audiobooks. I had thought I had normalized them all properly so their volume would not overwhelm the speech, but a few bad ones got through.

For example: https://youtu.be/VVlWWs7Fq0U

Now I need to figure out which songs are the loudest so I can fix or remove them.

Questions:

  • How can I get a value for overall loudness of an audio file?
  • How can I get a numerical value for peak loudness of an audio file?

Thanks.

1

Testing this SO answer:

$ sox /usr/share/example-content/Ubuntu_Free_Culture_Showcase/Jenyfa\ Duncan\ -\ Australia.ogg -n stat
Samples read:          21199104
Length (seconds):    240.352653
Scaled by:         2147483647.0
Maximum amplitude:     0.963440
Minimum amplitude:    -0.957550
Midline amplitude:     0.002945
Mean    norm:          0.094807
Mean    amplitude:     0.000000
RMS     amplitude:     0.131004
Maximum delta:         0.531006
Minimum delta:         0.000000
Mean    delta:         0.012794
RMS     delta:         0.021026
Rough   frequency:         1126
Volume adjustment:        1.038

It looks you could use the Maximum amplitude and either of Mean or RMS amplitudes (for overall loudness).

1

As this answer demonstrates, SOX works for this.
However, it is painfully slow and does not offer to correct (i.e. normalize) the offending files in the same process, therefore:

I love easyMP3Gain for normalizing MP3s !

Unfortunately, there seems to be no package for 17.10 Artful, but luckily the GUI packages for 16.04 Xenial are compatible and you can find them here!

This is probably not best practice but what I did was..

wget <your favorite ubuntu repo server here>libqt4pas5_2.5-15_amd64.deb
wget <your favorite ubuntu repo server here>easymp3gain-data_0.5.0+svn135-6_all.deb
wget <your favorite ubuntu repo server here>easymp3gain-qt_0.5.0+svn135-6_amd64.deb

Start with the libqt dependencies but install all the packages like this :

sudo dpkg -i libqt4pas5_2.5-15_amd64.deb

you will have to run sudo apt-get --fix-missing and sudo apt-get --fix-broken install once or twice to get all the libqt dependencies, and then rerun the dpkg -i commands

Once you are able to run easymp3gain you can get the source for mp3gain from sourceforge here, untar it. Change directory to the extracted files and make sure you have the build tools installed

sudo apt-get install build-essential

then build it with

sudo make
sudo make install

You might need to copy the binary, at least I had to do that

 sudo cp -p mp3gain /usr/local/bin/

Now you can run easymp3gain-qt ! Just select the folder with your MP3s and sort by Volume !

Screenshot of easyMP3Gain sorted by volume

I hope this helps !

1
  • I use another gui application - qtgain. the gui applications will install ok, but may not get the dependency package 'mp3gain' to scan mp3 files. if you can't find mp3gain package in ubuntu repositories, there is an additional repository here - launchpad.net/~flexiondotorg/+archive/ubuntu/audio – nik gnomic Jan 23 '18 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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