How to get the volume of MP3 file?

user315581 picture user315581 · Apr 13, 2010 · Viewed 12k times · Source

I need to get the average volume of the mp3 file in dB. This must be that when listening to multiple files automatically adjust the volume. In this case, the files themselves do not need to normalize. Ideally, I need to get a result in the command line, but fit and just an algorithm.

Answer

Ignacio Vazquez-Abrams picture Ignacio Vazquez-Abrams · Apr 13, 2010

The stat predicate of SoX gives all sorts of statistics about an audio stream:

sox <file.mp3> -n stat