Rip losslessly to flac with abcde

Oct 21, '05 06:01:00AM

Contributed by: extempore

All the ways I could find to rip to flac on OS X involved way too many steps for my taste. So here's my solution...

The first step is to install DarwinPorts. Once that's done, switch to the Terminal and type sudo port install abcde. Go and drink a beer while you watch abcde and all its dependencies invade your space.

Once that's done, create ~/.abcde.conf with the following contents. (If /dev/disk1 isn't your CD-ROM, then adjust it.):

CDROM=/dev/disk1
OUTPUTTYPE=flac
INTERACTIVE=n
PADTRACKS=y
OUTPUTDIR=~/Music/abcde
OUTPUTFORMAT='${ARTISTFILE}/${ALBUMFILE}/${TRACKNUM} - ${TRACKFILE}'
VAOUTPUTFORMAT='Various/${ALBUMFILE}/${TRACKNUM} - ${TRACKFILE}'
mungefilename ()
{
  echo "$@" | sed s,:, -,g | tr /* _+ | tr -d '"?[:cntrl:]
}
The disk arbitration daemon automatically mounts a CD when you insert it, but abcde works on the raw block device and can't access it if it's mounted. So we need a simple shell script. Call it rip, because it does:
#!/bin/bash
#

diskutil unmount /dev/disk1
abcde
diskutil eject /dev/disk1
Insert a CD and type rip. Drink another beer. When your new folder of glorious lossless flacs lands in ~/Music/abcde, the CD will pop out.

This approach gambles on the first result from freedb being what you want and not needing corrections. That is a thin proposition much of the time, but you can always interrupt and run abcde interactively if you see errors in the data.

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

Comments (39)


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