views:

329

answers:

3

I need to know the average volume of an mp3 file so that when I convert it to mp3 (at a different bitrate) I can scale the volume too, to normalize it...

Therefore I need a command line tool / ruby library that gives me the average volume in dB.

+1  A: 

You can use LAME to encode to mp3. It has options for normalization, scaling, and bitrate. LAME also compiles to virtually any platform.

Kekoa
lame does the scaling, but does it normalize?? I mean, can it evaluate the average volume per track? If so, how? I read the man and couldn't work it out...
luca
+2  A: 

You can use sox (an open source command line audio tool http://sox.sourceforge.net/sox.html) to normalize and transcode your files at the same time.

EDIT

Looks like it doesn't have options for bit-rate. Anyway, sox is probably overkill if LAME does normalization.

steamer25
A: 

http://mp3gain.sourceforge.net/ is a well thought out solution for this.

James Roth