Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: new script for splitting flac+cue: whether or not (and how) to embed cue sheets (Read 1545 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

new script for splitting flac+cue: whether or not (and how) to embed cue sheets

I've written a shell script that splits flac+cue albums into named and tagged tracks using metadata from the cue file.  I've called it "flactrack" for now and you can find it by searching for its name on github if you want to look at it. I don't know whether or not anyone but me will ever want to use it, and I'm not sure how best to gauge interest. My reason for posting, though, is mostly that I have a few questions about embedded cue sheets.

I'm pretty sure that the script is now more or less complete. It has all of the features that I personally would want it to have, except maybe for one. I don't know whether or not I should try to preserve indexing information by embedding cue sheets into the track files. This is complicated for two reasons.

The first is that by default (although this behavior is configurable) pregaps are appended to the previous track (except for the track 01 pregap), and therefore the index numbers would change and indices that were number 00 in the original cue would be number 02 (or higher) in the track files. This means that software trying to recompose the original files would either have to assume that the last index above 01 is always a pregap or it would have to look for a non-standard tag like "HASPREGAP=true" or something. I also don't know whether or not media players are ever designed to both look for embedded cue sheets and skip between indices rather than tracks. If so, doing this could change skipping behavior.

The second problem is that flac adds some non-standard fields when it embeds a cue file and I don't know why they're there, what they affect, or how to set them. For example, there's one called "is CD" and it always seems to be set to "true". Of course, these files are not CDs, but I don't know how to indicate that. Of the "lead-in" field, the flac documentation says "This field has meaning only for CD-DA cuesheets; for other uses it should be 0." By default it's set to "88200", but that number doesn't come from the imported cue file. I assume that there's some context in which these values matter, but I don't know what it is.

I think it would be cool to make the splitting process lossless with respect to metadata, but ultimately I think that doing so would require using tags that no other software is likely to understand. For that reason I don't know whether or not it's worth doing. If I do decide to try to do it, I also don't know whether there's any real value in having an embedded cue sheet versus simply storing all of the metadata in tags.

I'm looking for any thoughts or feedback. Thanks.