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: Bug with cue sheets and sample rates other than 44.1 kHz (Read 4243 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Bug with cue sheets and sample rates other than 44.1 kHz

When importing a cue sheet into a 48 kHz FLAC file with metaflac --import-cuesheet-from=foo.cue, track offsets (in samples) are completely off, because metaflac calculates them as if 75 "sectors" were always equal to 588 samples (44,100 / 75). I bet one or more of those numbers is hard-coded somewhere, whereas the calculation (samples per "sector" = sample rate / 75) should always be done.

Even though cue sheets were intended to be used only with CD-DA content (16 bit, 44,100 Hz), they still come in handy even with other types of content (in my case, 48kHz PCM audio from a DVD-Video).

 

Bug with cue sheets and sample rates other than 44.1 kHz

Reply #1
I'll check into the bug, the parser should reject frame numbering unless the sample rate is 44100.

the problem with defining sectors that way is they have to be fractional for some sample rates.  cuesheets for non 44.1 audio should use sample numbers instead of mm:ss:ff; flac should parse those fine.

Josh

Bug with cue sheets and sample rates other than 44.1 kHz

Reply #2
I checked the source code, "588" is all over the place. Anyway, since cue sheets aren't a CD-DA standard, do you have some documentation / specification about that? I don't really see why one should use samples instead of sectors with sample rates other than 44.1 kHz, dividing the sample rate by 75 just makes more sense to me...

One big issue for me, even if you're right, is that the sample notation would be incompatible with xmms' mp3cue plugin, which I use. The plugin only knows about frames, which it divides by 75 and multiplies by 1,000 to get a value in milliseconds (which works with all sample rates).

the problem with defining sectors that way is they have to be fractional for some sample rates.

Well, 44.1, 48, 88.2, 96, 176.4 and 192 kHz are all dividable by 75, which covers all commercial mediums (CD-DA, DVD-Video, DVD-Audio, MP3, etc...). But I get your point (took me long enough - I've had a hard time fully waking up this morning).