Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the volume of MP3 file?

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.

like image 837
user315581 Avatar asked Feb 04 '23 05:02

user315581


1 Answers

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

sox <file.mp3> -n stat

like image 197
Ignacio Vazquez-Abrams Avatar answered Feb 19 '23 02:02

Ignacio Vazquez-Abrams