Batch or one-time convert APE to MP3 via script
Mar 17, '08 07:30:02AM
Contributed by: krunk7
I've written a Ruby script that batch converts ape format files straight to individual ID3-tagged mp3 files for adding to your iTunes library. It uses all free software to do so. The muscle work is done by:
- Mac ape conversion tool (ape => wav) named SuperMMX. There's no MacPorts version of this utility, so you have to hand install. SuperMMX - Google translation.
- lame mp3 encoder using --preset extreme to convert to monolithic mp3 (available from MacPorts)
- mp3splt to read the ape cue files and split the monolithic mp3 into tracks with ID3 tags. (also in MacPorts)
Notes:
- mp3split uses the -f (frames) setting assuming a variable bitrate. If you tweak the lame settings, then you probably want to read the man page for mp3split and tweak that, too.
- I've included status bars for conversion and informative output.
- I've also included fairly robust error checking, but I knocked it out pretty quick. If you run into errors I overlooked, let me know and I'll add them.
- Contains a verbose mode so you can see exactly what's going on behind the scenes.
- Uses ansi term colors for easy reading (oooo ahhh colors).
- Provides a --clean option to move the old files (ape, cue, wav, monolithic mp3) to the trash, leaving only the desired mp3 tracks.
- --test mode if you just want to see what happens.
- Complete usage information.
Needed ruby modules:
- rubygems
- optparse
- ostruct
- term/ansicolor
- pathname
- fileutils
I believe all of these packages are in Leopard by default except term-ansicolor.
I just did this pretty quickly, so I could have overlooked a thing or two. Please let me know if I did. As always, YMMV. However, I've successfully converted single ape files as well as over 80 ape files in a batch conversion with no problems.
[robg adds: A queue review site commenter noted the availability of Max, a free GUI tool to do the same thing. I'm running the script because I haven't tested either solution, so I'm not sure if one does things the other can't. Also, a script can more easily be run remotely, in case you're doing this over a network.]
Comments (7)
Mac OS X Hints
http://hints.macworld.com/article.php?story=2008030912372738