-
Multiprocess Book-on-CD Ripping
The most recent iteration of ripping a book-on-CD to bits suitable for a small MP3 player begins by defining the metadata:
author="Whoever Wrote It" title="Whatever It May Be About"Set up a suitable directory for the MP3 files, with a subdirectory for the WAV files direct from the CD:
mkdir "$author - $title" cd "$author - $title" mkdir wavesThen unleash
cdparanoiaon each disk, but with its error checking dialed back to a minimum because most errors don’t produce much audible damage:d=01 ; cdparanoia -v -Y --never-skip=1 -B "1-" waves/D$d.wav ; eject cdromIn some cases, however, a nasty gouge (the previous owners being careless, alas) can jam
cdparanoiamidway through a track, so I fetch all the remaining tracks:d=10 ; cdparanoia -v -Y --never-skip=1 -B "6-" waves/D$d.wavSometimes re-cleaning the disc and re-reading the offending track produces a better outcome:
d=10 ; cdparanoia -v -Y --never-skip=1 -B "5-5" waves/D$d.wavWith all the WAV files collected, I now know how to unleash multiple
lameconversions for all the tracks on each disc:for d in {01..12} ; do for t in {01..19} ; do if [[ -f waves/track$t.D$d.wav ]] ; then lame --silent --preset tape --tt "D${d}:T${t}" --ta "$author" --tl "$title" --tn $t --tg "Audio Book" --add-id3v2 waves/track${t}.D${d}.wav D${d}-T${t}.mp3 & fi ; done ; wait ; doneThe disc and track ranges correspond to notes written on paper while ripping the CDs, there being no automagic way to collect the information.
That may be easier to read with the control structures spread out:
for d in {01..12} do for t in {01..19} do if [[ -f waves/track$t.D$d.wav ]] then lame --silent --preset tape --tt "D${d}:T${t}" --ta "$author" --tl "$title" --tn $t --tg "Audio Book" --add-id3v2 waves/track${t}.D${d}.wav D${d}-T${t}.mp3 & fi done wait doneAffixing an ampersand (
&) to thelamecommand drops it into the background, where it runs as CPU time becomes available. Thewaitafter the first loop stalls until all of thelameinstances for each CD finish.The kernel scheduler manages to keep the GUI responsive while a four-core CPU makes short work of the entire CD.
When it’s all done, transfer the MP3 files to the player:
cd .. sudo mount -o uid=ed /dev/sde1 /mnt/part rsync -vrtu --progress --exclude="waves" "$author - $title" /mnt/part/Music sync sudo umount /mnt/partFetching commands from history eliminates the need to remember all that, but now it’s written down where I can find it for the next desktop box.
Life is good!