Friday, July 17, 2009

EAC, FLAC and embedded Cuesheets

For the second time, I’ve started the process of backing up my CD collection onto my computer.  I’m doing this with two goals in mind:

  1. Allow me to restore an identical copy of a CD if I were to misplace it.
  2. Allow me to use the backup to produce a copy of the tracks in any format quickly and easily.

I’ve chosen to use EAC to rip the CD because it can correct errors on scratched discs, with the AccurateRip feature you can identify when a rip may not be perfect.

And I’ve chose to store the CD as a single file in FLAC format.  There are other lossless formats that might offer better compression, but FLAC is open source so I can be confident of the formats longevity.

The reason this is the second time I’ve attempted a backup is because I spent so long researching the right configuration for EAC that by the time I got to the FLAC side of things I ran with some settings I seen online which wasn’t the ideal choice when it comes to handling cuesheets.

Cuesheets describe how a single audio file should be split up into tracks.  EAC will create the cuesheet as a separate file which totally fine—unless, like me, you would feel more confident with your backup if the cuesheet can’t be separated from the FLAC file.

The solution for not allowing the cuesheet to be seperated from the FLAC file is to embed it.  But there are two ways to embed a cuesheet:

  1. Embed as a tag named CUESHEET.
  2. Embed in the CUESHEET block.

I’ve chosen to embed the cuesheet in both the tag and block of the FLAC file.  I made this decision because the block option only stores the track running times, necessary to recreate the CD using CD burning software, whilst the tag option allows you to store track information including the track titles which can be used by music players and convertors. 

You could just use the tag option, but all FLAC software should read the cuesheet block, whilst cuesheet tag support could vary and I want to avoid having to export the cuesheet from the tag in this situation.

So here’s the punchline—my EAC command line options to import the cuesheet automatically after ripping:

-5 -V -T "ARTIST=%a" -T "ALBUM=%g" -T "DATE=%y" -T "GENRE=%m" --tag-from-file=CUESHEET="%a - %g.cue" --cuesheet="%a - %g.cue" %s

Here’s a quick breakdown of the parameters meaning:

  1. -5 : The amount of compression (between 1 and 8)
  2. -V : Verify the encoding
  3. -T : Each of the values after the T’s are tags.  I’ve selected to use only tags recommended by the OGG specification.
  4. --tag-from-file : Creates the CUESHEET tag
  5. --cuesheet : Creates the CUESHEET block
  6. “%a - %g.cue” : This will resolve the file name of the cuesheet EAC generates.
  7. %s : The name of the Wave file to be encoded.


Fabrizio said...

Very useful! Thank you man

Anonymous said...

With this process do you have to make the cuesheet before ripping? If the cue sheet must be generated manually before which option do you use Alt+S, Alt+M, or Alt+O?


microUgly said...

With this method the cuesheet is automatically created if you go to Action > Copy Image & Create CUE sheet > Compressed. There isn't a keyboard shortcut, unfortunately.

roddersg said...

Thanks for the tip, your method works, however my Squeezebox does not seem to recognise it. Foobar2000 on the other hand does.

It's definitely a nice handy way to save the cue sheet securely, and I am definitely going to use it.

BTW how about if you already have a flac file, how do you embeded the cue sheet?

microUgly said...

Yeah, I wouldn't expect a lot of support for Flac and cuesheets. But my idea was to use Foobar to convert the flac quickly and easily to any other format for any device, all pre-populated with the correct tag information.

There's a command-line tool that comes with the Flac encoder called metaflac which can import a cuesheet into an already existing Flac file. I believe the parameters are the same.

Anonymous said...

do you know any easy way to embedd the cuesheet in existing Flac file? I've foobar, but it create separate file only..

microUgly said...

I only know of using the command line tool, metaflac, which comes with the flac encoder. I believe there are some GUI wrappers for it though. Check the Flac website.

Anonymous said...

In meantime I detected that foobar can embed the cuesheet in the flac by Utilites/edit cuesheet and then check "enable embed couesheet".
Only missing how embed album picture


Dec said...

On reasonably modern computers, there is no reason not to go for the maximum compression, using -8 instead of -5.
Each FLAC run will take a bit longer and require more memory, but the resulting FLAC files will be smaller.
This might make a small difference to each individual album, but over a full collection it could make the difference between needing to buy a new external HDD or not (or an extra box of DDS tapes or BD-ROM discs or whatever your backup medium is).
The FLAC codec needs very little processor power to decode, so the compression ratio makes very little difference at playback, unless your playback device is seriously underpowered.
Also, please make sure you have the latest FLAC version. Some GUI front-ends are still shipping with older versions of libflac or FLAC.exe years later.

microUgly said...

Thanks for the tip Dec. I did actually end up compressing all mine at 8 for the reason you suggested, a small saving per album can add up to a lot across an entire collection.

Anonymous said...

This is such an amazingly simple solution for automatic embedding of the cue sheet. I can't believe it's taken me this long to find someone who's found such a solution. Originally, I thought it wasn't possible from within EAC, so I used my own custom batch script. Now I don't even have to add the track titles as those are already found within the cue sheet. One thing, though: is it possible to have the cue sheet automatically deleted? I have no immediate use for it after my FLAC's been encoded--and if I want it later, of course, I can simply extract it.

Post a Comment