There is a very common problem with modern CDs -- they are all mastered at different volumes. So when you are just listening to one CD, this is OK: you only need to adjust volume once and listen the whole CD. But if you are converting it to MP3 or AAC formats, and intend to listen to tracks from different albums randomly, the situation gets much worse: having to adjust the volume for each track is really annoying. But without adjusting the volume, the music just doesn't sound right -- it's either too quiet or too loud.
iTunes actually has the ability to fix this kind of problem with the Sound Check feature, but unfortunately the method by which Apple corrects the volume is not the best one -- it definitely changes volume, but it still doesn't sound quite right. I'm no expert at this, but smart people say that volume perception by the human brain is not that simple, and to adjust it properly it should be taken into account.
So here comes another open source tool, mp3gain, which uses a lot smarter method of volume adjustment, and relies on an MP3 format feature to adjust volume gain without transcoding. This means that there is no quality loss. Recently mp3gain was further improved to support the AAC format, and now we have our ultimate solution. It's called AACGain, which supports both MP3 and AAC formats, has a port for Linux, and can be compiled on Mac OS X, too. I tried to find a version of aacgian compiled for Mac OS X, but failed, so I made it myself, and put it on my friend's web server [396KB download]. For more details, check the forums on Hydrogen Audio, the mp3gain web page, and the AACGain web page.
Read the rest of the hint for a few notes...
[robg adds: I have mirrored (396KB download from hints) the above file locally on macosxhints, just in case. And since it's a binary from an unknown source (nothing against the author, but I'm paranoid about such things by nature), I tested it prior to publishing this hint for all of you. After downloading, I ran Little Snitch before launching AACGain, blocking all outbound connections to the net. Little Snitch reported no activity when I tested AACGain on an MP3 file, so I think it's fine -- as with any unknown binary, though, use at your own risk.]
A few notes:
aacgain -r -p -t -k *.mp3 *.m4a
The above command will adjust every track in curent directory to 89dB volume. -k means automatically lower this number if clipping may occur, -t is required to make the file as compatible as possible with different players (iPod Shuffle may have problems otherwise), -p means preserve timestamp of file (optional). Also during converting, it will create temporary files (because of -t) and will require disk space of the same total amount as size of original files. So if you are trying to convert 1GB of music, make sure you have 1GB of free space in the directory. If you want to avoid this issue, launch it from a shell script for each file separately. For more details, search the forums on hydrogenaudio.org.Mac OS X Hints
http://hints.macworld.com/article.php?story=20050403185626637