Apr 07, '05 09:14:00AM • Contributed by: atverd
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:
- I'm no expert, don't know anything and just compiled it on Panther 10.3.8. It worked fine for me -- tested it on 2,500 MP3/AAC files collection for my iPod, and it works perfectly. Listening experience improved so much, that this is almost impossible to believe!
- This is a command line tool and you have to run it from Terminal. It doesn't support music from the iTunes store. And you have to disable the SoundCheck option in iTunes and/or the iPod.
- Before you do anything to your music files, please back them up!
- It's little tricky to run it properly and it takes time. Here's what I use:
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.aacgain -r -p -t -k *.mp3 *.m4a - It's also possible to adjust on per album basis -- so all tracks from an album will sound relatively the same, and average volume for the whole album will be 89dB. Use -a instead of -r, and specify only tracks from the same album in the command line.
- If you adjust tracks which are already part of iTunes library, you'll need to resync them again in iTunes -- select them all, do a "Get Info," mark some empty field which you don't need (I use Comment), and click OK. It will be erased in all tracks, and tracks will be resynced with iTunes database. You may also move needed files to another location, delete them from the library, readjust, and import again.
- Did I mention backup? Don't blame me if something goes wrong :)
