Ripping wavpack images with integrated cuesheets with rubyripper using
2013-01-18 11:58:40
I recently decided to start ripping my CD collection or at least parts of it to a lossless format, and I chose wavpack because hardware compatibility is no issue for me and should I need it, I can just convert my saved tracks to mp3. However, as I was thinking more of images, I wanted to convert my disks to single .wv files with integrated cuesheet as I felt that'd be the closest I can get to a real image. If you are looking for instructions (can be applied to similiar scenarios as well) read on. Mods: if you think this belongs into the wiki, feel free to add it, I have no account there. I will go into a bit of detail here to explain why I set all this up like I did. If you're just looking for the perhaps not-perfect solution, skip to the second-last codebox. rubyripper supports creating cuesheets for rips and also wavpack as an external codec. However, these two programs both seem to suffer a bug each (or a bug and a not-too-well-advertised feature) that, in combination, prevents one from backing up his discs under Linux the way I described. According to the official wavpack documentation , wavpack's -w "Cuesheet=@*.cue" should make wavpack import subtrack information from a .cue file in the working directory. It did not for me. It wasn't a syntax error either, as I believe, because when I did -w "Cuesheet=@Exact Filename here.cue" it just worked. It was a single cue file in the working directory, but wavpack wouldn't read from it. Might be a shell problem, I don't really know, but I didn't like it. So, to circumvent this (and also get a cleaner solution), wavpack is called with the exact filename of the cue file from rubyripper, which is "Artist - Album (other).cue" for me. So we just use this as our "other codec in rubyripper:wavpack -hhm -w Cuesheet="%a - %b (other).cue" %i -o %o.wv which unfortunately doesn't work. To make it easier for the user, rubyripper replaces all variables with their proper values encapsulated in double quotes in order to retain spaces. However, as not to break anything, the user-supplied command-line has to be cleared of double-quotes beforehand. From rr_lib.rb: (This codebox is supposed to be spoilered for readability.) This leads to wavpack being called with -w Cuesheet=@"Artist" - "Album" (other).cue ... with which, of course, wavpack doesn't know what to do. The easiest solution now IMHO is a shell script like this:#! /bin/bash wavpack -hhm -w Cuesheet=@"$(echo $2 | sed s/.wv/' (other).cue'/g)" "$1" -o "$2" (remember to make it executable!) which can then be called in rubyripper via /path/to/yourscript.sh %i %o.wv Of course, this only works if your .wv and .cue-files are named similiar. As I mainly backup albums, this works for me right now. I don't know how rubyripper decides how to name the cuesheets, so the script might be of limited usefulness. I spent quite some time on finding a solution nevertheless, and I thought it might be helpful for some as the scenario is not too uncommon. Perhaps some shell guru (or a programmer in a "real" language) can add some command line parsing and some extra features, I'd appreciate it Hope I could help or inspire someone. Now if another player besides foobar supported this, it'd be awesome. I have it running under wine here. Oh, how I would love to see a port. Edit: title is truncated or I'm too tired to actually write one. Can a mod give this a proper name, pretty please?