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: Is splitting and joining tracks a strictly lossless procedure (Read 220 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Is splitting and joining tracks a strictly lossless procedure

Hey guys,

Just something i've been wondering about. Sometimes, when things have been badly cut, due to bad cue file time stamps, or general carelessness, I "recut" things by merging the sequential files, and then either making a new cue file, or editing the old one, so that they can be output in the correctly split way (obviously this implies that the files are basically one long digitisation to begin with, and when they were split, no silence was removed inbetween them). To my understanding, as long as you're working with a lossless format and doing a lossless conversion, such procedures should have zero impact to the audio file, even if you theoretically were to do it hundreds of times in different places (split, and merge, and so on...).

Well, on this occasion, I am not using it for something casual, something a little more serious, and I'm questioning myself, if my understanding is correct. If there are any smarty pants people who can definitively answer (the title question), I would be very glad. I much prefer to use foobar over audacity for splitting/merging files - can't really trust audacity's "merge lines" and what they do with the waveform, and then you have to worry about dithering, sample rate, output format, etc - foobar is a thousand times easier.

Thanks in advance! If all else fails, i can do some testing, and then maybe do minus comparisons, and see if the "messed-with-a bunch" file is identical to the one that hasn't been touched, but that would take me some time, and also im pretty sure this might be a nice question to have a certified forum answer for, somewhere.

Re: Is splitting and joining tracks a strictly lossless procedure

Reply #1
Splitting and joining may be lossless. That's the best answer you can get. (its the same for splitting an stereo file to 2 mono files)

If it's lossless and bit-perfect or not depends on program code. Why? Because some audio editors treat cut/copy commands the same than other edits (gain, filtering, etc.), thus they do 32 bit conversion on the fly... and even if you don't dither, if you just save the files -as is- after slicing... and you merge the files again, you will not get a bit perfect clone of the original. The same can be said about merging and then splitting. Now, whether the difference is audible or not is another discussion (in short: no), but is not bitperfect .

sox can do it right. Audition doesn't. Izotope doesnt. (*)
Code: [Select]

Sox Join
sox "00.flac" "01.flac" "out.flac"

To split again
sox "out.flac" "00.flac" trim 0 0.427
sox "out.flac" "01.flac" trim 0.427 -0

Splitting a cue file should be both lossless and bit-perfect in "most" programs if coded right, though.

In some programs it's only lossless... because technically you split it into multiple lossless tracks, but it's not bitperfect since gap handling differs (and you can not get the original file then). I consider that lossless because you can also perfectly match the audio parts of the original and split tracks. i.e. what's converted, is done right. Is the missing part (gaps) the one mismatching. (**)

(*)  There are also other problems in the equation. Izotope RX5 had a bug which made loading and saving right away a flac file without doing anything, to not produce a bit-perfect copy.... it was never fixed. Reported it multiple times. You would say that's a minimum for a program which costs thousands of dollars hahaha. You have to save to wav and then convert the wav to flac in another program as workaround.
(**) Contrary to DAWs like audition, etc. where you are also exporting not bit-perfect copies of the portions of audio.

EDIT: About foobar, if you are talking about using converter... merging tracks into one file is bitperfect.Splitting (if you force the same break points than the input) too.

A tool specifically thought to do what you want is cue tools:
Select encode: single file + cue. All in one step. Edit the cue according to your corrected break points.

Re: Is splitting and joining tracks a strictly lossless procedure

Reply #2
Hi regor,

I appreciate the answer, although i have a few comments to make regarding what you wrote.

In my original message, I was talking/asking specifically about foobar2000, seeing you mention 3-4 editing programs certainly made me a bit confused, but if you were just giving examples based on your experiences, and what you know, that makes sense.

The thing with foobar is that I dont think many people (including myself) really consider it to be an audio editor, but instead more of a library manager, tag maintainer, file converter, with a few bonus features. it is for this reason that I class it in a different category, than audition, izotope RX, audacity, etc.

I have a bit of a problem with your use of the term"bitperfect", I assume you are not talking about bit-depth but about the actual number of bits/bytes/kb/mb that a file takes up - I find this to be not very useful metric for just about anything, extensive tagging to a file (for example, writing a lot of text in the "comment" tag), or attaching a "front cover" to the file, this can all affect the resultant file size, plus, you could do two conversions from the same Wav file, both into, for example, flac, at all the same parameters, and end up with two slightly differently sized files, even though both are lossless (because compressed lossless relies on how much effort your computer is able to commit for processing power to squeeze the file, and that effort will not always be identical.

The better term might be "sample-perfect" (referring to the number of samples that a track takes up, this is also an indicator of file length). Convert from wav, to flac, to ape, to wav again, the number of samples stays the same the whole time, because the statistics of the audio file, and the length, is conserved - convert a big flac file into seperate tracks using a cue file, and if you get a different number of samples from the summed tracks, compared to the original big file, that means the length of the two is different, so I am always checking the number of samples. It might also be the reason why you're not getting bit-perfect flac files - izotope (and pretty much all audio editor programs) do not work in flac, or in mp3, etc, they all work in wav, and so your imported flacs get converted to wav, and back to flac upon export, even if you do zero processing within the program, and that re-conversion doesn't always produce a "bitperfect" result, and this isn't even an indicator of a problem, as it should consistently be sample-perfect.

But that is a bit of a tangeant I went on, sorry! To conclude, your answer of "may be" answer is perfect in a way, it just means I should conduct some testing myself.

Re: Is splitting and joining tracks a strictly lossless procedure

Reply #3
Check edit, as noted it's not only a matter of testing. If you change gaps, and you delete silence, you can't restore the original file. If you don't and simply join and split but all the audio is still there, then it is. At least with foobar. It's not with other programs. It may not be relevant to your use-case, but that's the real answer to your question.

I gave you tons of examples because it's clearly not obvious what split/join means on every program. You mentioned Audacity, that's an editor on the same league than Audition or Sox.

I recommend you to use cueetools, since it also creates a cue (which you can easily edit to recut). Do you prefer foobar? It's ok too. But again, if you edit the cue and change gaps in a wrong way, forget to restore the original file.

Bit perfect means after decoding the file you get an exact -audio- copy of the original one. If you take a wav file and a flac file (of the same track), they are clearly not the same files (format, size, etc.). They have been converted losslessly, and they are also bit perfect copies (after decoding them).

Bit perfect only relates to the audio part, it doesn't care at all about tags, ...

Now... if you find the term a bit misleading, can't discuss about it hahaha but anyway it's not my use of the term, it's a well established term since decades, referring to a perfect bit to bit copy of the audio (not the way you encapsulate it, neither its size, nor bit depth\samples).

Re: Is splitting and joining tracks a strictly lossless procedure

Reply #4
Sometimes, when things have been badly cut [...]
So I take it that everything is the same digital stream format (44.1/16 from a CD, presumably).

The lossless formats are accurate down to the single sample so yeah: splitting and joining is OK.
(Assuming you use software that isn't stupid enough to destroy stuff - so stay off Medieval. fb2k does it right, and CUETools if you have CDDA format, and ...)

As for the phrase "bit-perfect": It usually refers to an audio setup's ability to deliver the same decoded audio bits the file encodes. For counterexample, back in the day there would be sound cards that would resample everything to 48k. That's why "bit-perfect" usually refers not to metadata and not even to codec.
High Voltage socket-nose-avatar

Re: Is splitting and joining tracks a strictly lossless procedure

Reply #5
All audio editors will expand the word length to 32 bit float or higher when doing any processing at all, even small volume adjustments or mixing. You'll want to save the file as fixed length 16 or 24 bit which will usually require dither, or if not, you'll have truncation distortion. So technically, no it's not lossless. In practise, for a small amount of processing, you probably won't hear a difference as they will all be below the threshold of hearing. As a mastering engineer I'm dealing with this stuff every day.

Re: Is splitting and joining tracks a strictly lossless procedure

Reply #6
All audio editors will expand the word length to 32 bit float or higher when doing any processing at all, even small volume adjustments or mixing. You'll want to save the file as fixed length 16 or 24 bit which will usually require dither, or if not, you'll have truncation distortion. So technically, no it's not lossless. In practise, for a small amount of processing, you probably won't hear a difference as they will all be below the threshold of hearing. As a mastering engineer I'm dealing with this stuff every day.
Sure you didn't mean to post this in https://hydrogenaud.io/index.php?topic=121219 ?
High Voltage socket-nose-avatar

 

Re: Is splitting and joining tracks a strictly lossless procedure

Reply #7
Sound Forge (at least older versions) work in the specified bit depth. The user can manually promote it to 32-bit from the status bar when needed. There is also a switch to do it always, but I don't like it. It's a good tool for visual cutting with preview, when command-line and cues would require trial and error. The waveform display is fast for huge files. CDWave is also good, but cutting accuracy is limited.

The way iZotope RX does it is wrong, a de-click applied to a few samples promotes the entire file, when the new samples don't actually have great precision to begin with.

 
SimplePortal 1.0.0 RC1 © 2008-2021