A perl script to rip and normalize songs for iTunes

Feb 21, '07 07:30:03AM

Contributed by: stsmith

I received an iPod for Christmas -- I've admittedly been resisting this convenient technology because I am not satisfied with the audio quality of MP3s, even at the higher bitrates. I've revisited this issue since receiving my gift, however, and I'm mightily impressed with AAC at 256kbps: I've done listening tests of AAC against uncompressed audio with strings, voice, symphonic, and amplified music, and am sold on 256kbps AAC. It requires nice components for me to discern the difference from the original, and I sure can't on the little iPod.

I began converting my CD collection to AAC, but quickly became dissatisfied with Apple's tools to do this, either through iTunes or via Max. Neither does track normalization for a large collection, and Max's rips often produce white noise output for me.

Having used and trusted cdparanoia and cdrdao to obtain high quality rips for years now, I wrote a perl script based on these tools to rip a CD, grab the CDDB information, normalize the tracks, convert everything to a specified codec (AAC, ALAC, flac, mp3, etc.), and add the CDDB information to the resulting files. The script also does the correct UTF-8 conversion for non-English scripts. (I have an extensive Arabic collection from Beirut -- it's pretty neat to have the correct Arabic script appear in iTunes). To use this script, you'll have to download and build your own executables of the following tools (you must know how to type ./configure; make; make install):

I've written this script for my own needs, but it's easy to modify to incorporate other formats. To use, save the text to a file named cd2codec, do chmod a+x cd2codec, get/build the required tools, and type cd2codec --help for usage instructions. If you wish to add foreign language scripts to your mp4tags, then also grab a copy of my transliterate perl script, too, which provides the octal UTF-8 transliteration of Arabic and Greek. Cyrillic, Hebrew, and others are possible, too, but not implemented.

[robg adds: I haven't tested this one...]

Comments (14)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20070214211433759