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: Joining multiple tracks corrupts track lengths in high sample rates (Read 1206 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Joining multiple tracks corrupts track lengths in high sample rates

Versions: 1.3.17 and 1.4b3
Problem: Joining multiple tracks corrupts track lengths in high sample rates
Description:

When multiple 96/24 files are merged with "Generate multi-track files" option from the internal converter module, the sample lengths of the tracks are not preserved. The conversion is a FLAC-to-FLAC (v1.3.2) conversion.

Screenshot:


The highlighted tracks are from the merged file. With the faulty conversion, some of the tracks (2, 4, 6) now have longer lengths, and some of the tracks (1, 3, 5) now have shorter lengths.

There should be no change.

Because FLAC stores the track offsets as sample numbers, I think this could be related to fb2k writing the cuesheet in CD-DA compatible format (min:sec:frametime), rather than the FLAC itself.

Re: Joining multiple tracks corrupts track lengths in high sample rates

Reply #1
The cuesheet format is used when joining multiple files to a single file in foobar2000's converter.

Cuesheets are designed to address audio as 1/75 of second for a single frame.  That's 588 samples for standard CD audio (44.1 KHz).  If we take 96 KHz and divide it by 75, you get 1,280 samples per frame. 

The source in particular as with any self-recorded albums or downloaded music often isn't set up with this in mind, so you get time variations like this.  If this actually happened with a CD rip from a lossless source then I consider it a bug but since this doesn't seem to be the case here, it's simply the limitations of the cuesheet format manifesting itself.

The time format for CDs is MM:SS:FF which is what the cuesheet format itself uses.

The workaround is to use output as individual files option instead when using the converter.  Track lengths will always be the same here, assuming it's just a straight conversion between two different lossless formats (compressed or uncompressed).  This should avoid rounding errors.

Re: Joining multiple tracks corrupts track lengths in high sample rates

Reply #2
@Chibisteven

Thanks for the comments :) I too realized that this "problem" might be better off posted on the general topic forum, but I wasn't really sure about it so I ended up posting it here.

The tracks are purchased tracks from an online store, so this would not be the case.

The thing is, I would like to have my files joined album-wise because it is easier and more comfortable for me to manage them that way. If there was an update to the cuesheet format that would be really great.. Especially in these days the music files people are dealing with are not limited to CD resolutions, so the old cuesheet format might need an update to better serve the modern era. It shouldn't be really hard to update it while keeping it compatible with the old format, but I guess the real problem would be whether there is enough need to actually do this.

Re: Joining multiple tracks corrupts track lengths in high sample rates

Reply #3
The tracks are purchased tracks from an online store, so this would not be the case.
It can happen regardless if you purchased them online or not.  It's pretty much is the case.  There's a reason why programs designed for burning CDs attempt to make this whole thing a lot easier (easy CD Creator, etc.).  You don't know where it was sourced from as far as anything online goes or if the online store made additional changes.

The thing is, I would like to have my files joined album-wise because it is easier and more comfortable for me to manage them that way. If there was an update to the cuesheet format that would be really great.. Especially in these days the music files people are dealing with are not limited to CD resolutions, so the old cuesheet format might need an update to better serve the modern era. It shouldn't be really hard to update it while keeping it compatible with the old format, but I guess the real problem would be whether there is enough need to actually do this.
The cuesheet format was designed for imaging discs and burning them originally in CDR Win as a disc at once method.  Updating it, just breaks a ton of applications in the process and it's never going to happen.

If you want precise sample by sample track transitions you may need to use something else.

What you linked to is something that can only be done when encoding a FLAC file or using metaflac.  It embeds it in the file in such a way that none of the index points are readable in a hex editor unlike other forms of embedding such as vorbis comments which are readable.  Supposedly someone could write something that allows that to be edited but I've haven't seen such a tool.  A cuesheet can be embeded in a FLAC as vorbis comments or in the cuesheet block.

Re: Joining multiple tracks corrupts track lengths in high sample rates

Reply #4
Yes, I should’ve put that more clearly. It is not a bug case since they are not a CD rip, and altering the cuesheet format without preserving the existing one would break the backward compatibility.

 

Re: Joining multiple tracks corrupts track lengths in high sample rates

Reply #5
To create multi-track files files and preserve exact tracks lengths you can do it several ways:
1) Re-encode flac to flac in oga container and merge with command copy /b. Although flac in oga doesn't support embedded pictures
2) Re-encode to ALAC in m4a container with chapters
3) Merge flac files to mka with chapters