Joe Edmonds Blog
   

Email

Subscribe
RSS



See more of joe's picks at ThisNext.
Shopcast
powered by
ThisNext


       
Mon, 26 May 2008

ripping to flac + cue for slimserver using abcde in ubuntu hardy

Ubuntu Hardy Heron erased my mp3 collection. OK, I was a little reckless in assuming that, if I installed it over my existing ext3 partition, it wouldn't overwrite /usr/local/mp3/.

Photorec actually was able to recover over 15,000 mp3 files. Unfortunately, I don't own 15k mp3s. It had recovered 15k mp3 fragments. Fun to listen to on shuffle play (sounds like somebody fiddling with a radio dial in a city full of people exactly like me) but not really "recovered" in any useful way.

My take-away from this experience? Store files like this (not sensitive, but expensive to reproduce) on a partition that has good undelete support. Ext2 supports undelete; ext3 does not support undelete.

On the bright side, this is a perfect excuse to re-encode my entire collection in a lossless format. I'm still trying to decide whether to pay $1-2 per CD to have an outside service rip and encode my CDs or just feed CDs into the machine myself. In the meantime, I'm at least trying to identify the perfect format. I think I've found it: FLAC + cue seems like the best "copy of the CD" approach. Slimserver plays them gaplessly and you can burn a FLAC + cue file to a CD directly, if necessary.

In the past, I've liked abcde for ripping CDs, so I used the following command to rip the CD and the cue file in ubuntu hardy:

abcde -1 -M -p -o flac

This worked fine, except that slimserver wouldn't read the FLAC file. It just showed 10 tracks, each with the title of the album. After a little fiddling, I found that changing the "FILE" line allowed slimserver to read the file. So here's a messy litte script to fix up the cue files after ripping:

find . -name '*.cue' -print | xargs perl -pi.orig -e 'my $flacname = $1 if $ARGV =~ m#/([^/]+\.flac)\.cue$#; s/^FILE "dummy\.wav" WAVE$/FILE "$flacname" FLAC/;'

[] permanent link