Sunday, November 27, 2016

Ripping an unplayable CD and burning a new one

We bought an audio CD (stop smirking please) on a recent trip, played it once or twice at home, and... now it won't play.
…which reminds me of John Hartford's "Don't leave your records in the sun" but we didn't leave our CD in the sun.

Anyway, I remembered that there was a program that would try really hard to read damaged CDs, but I couldn't remember its name. After some web searching I was delighted to find the name "cdparanoia" but discouraged to read that development had stopped in 2002. Further searching revealed a 2008 update, so I tried this on Debian jessie:

$ sudo apt-get install cdparanoia
Hooray! It was found! Then after RTFMing I typed:
$ sudo cdparanoia -sQ
cdparanoia III release 10.2 (September 11, 2008)


Table of contents (audio tracks only):
track        length               begin        copy pre ch
===========================================================
  1.    27945 [06:12.45]        0 [00:00.00]    no   no  2
  2.    24852 [05:31.27]    27945 [06:12.45]    no   no  2
  3.    33420 [07:25.45]    52797 [11:43.72]    no   no  2
  4.    29895 [06:38.45]    86217 [19:09.42]    no   no  2
  5.    23468 [05:12.68]   116112 [25:48.12]    no   no  2
  6.    14717 [03:16.17]   139580 [31:01.05]    no   no  2
  7.    15945 [03:32.45]   154297 [34:17.22]    no   no  2
  8.    14255 [03:10.05]   170242 [37:49.67]    no   no  2
  9.    16288 [03:37.13]   184497 [40:59.72]    no   no  2
 10.    20465 [04:32.65]   200785 [44:37.10]    no   no  2
 11.    66120 [14:41.45]   221250 [49:10.00]    no   no  2
TOTAL  287370 [63:51.45]    (audio only)
$
NOTE: the first few times I tried that, it told me it couldn't read the drive/disk. I typed random things and then the above worked. Maybe it was just the -s? Anyway, after more RTFMing I decided to rip the CD into separate files, but first I wanted to find a nice place to put the files. Would the home directory be okay?
$ df .
Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/sda6      882859164 174497320 663492076  21% /home
$ mkdir finland-cd 
$ cd finland-cd
$ 
It occurred to me that maybe it wasn't necessary to say sudo so I tried it without:
$ cdparanoia -B -- -11
cdparanoia III release 10.2 (September 11, 2008)

 
Ripping from sector       0 (track  1 [0:00.00])
          to sector  287369 (track 11 [14:41.44])

outputting to track01.cdda.wav

 (== PROGRESS == [                              | 027944 00 ] == :^D * ==)
… you get the idea
$ ls
track01.cdda.wav  track04.cdda.wav  track07.cdda.wav  track10.cdda.wav
track02.cdda.wav  track05.cdda.wav  track08.cdda.wav  track11.cdda.wav
track03.cdda.wav  track06.cdda.wav  track09.cdda.wav
$
Now, about burning: I didn't remember the command for that, either. A web search led me to brasero, whence
$ type brasero
brasero is /usr/bin/brasero
$ brasero&
I clicked on "Audio Project" or maybe "Audio CD", and fumbled around a bit before noticing the "+" sign near the top; this allowed me to add those 11 files to the project. NOTE THAT the order of tracks reflects way the files appear in the dialog box. So if you've got the file selection box set to show newest-first, then track 1 will be the newest file, etc.

I clicked on "Name" to sort by name (I might have had to click twice), and got track01.cdda.wav as the first track, track02.cdda.wav as the second, etc.

Then I selected Project→Burn, or maybe the "Burn" button in the lower-right corner of brasero's window. It worked perfectly; I'm listening to Bach now.

No comments: