Page 4 of 4
Re: Sample Data Export/Import is “bit-perfect”/lossless?
Posted: Wed Oct 25, 2017 10:40 pm
by steve
Kdmeizk wrote:It means dithering is applied, so there is no more "bit-perfect"/lossless!
Yes it does, unless you turn off dither in preferences. Unfortunately Audacity is a bit overenthusiastic about applying dither, and could be a lot smarter.
Re: Sample Data Export/Import is “bit-perfect”/lossless?
Posted: Thu Oct 26, 2017 12:16 am
by Kdmeizk
So, I can disable dither if (non-exhaustive list, but I will probably only do these actions):
- input and output file have the same bit-depth + sample rate + number of channels, only if:
- → I simply import/export with the same characteristics (= “bit-perfect”/lossless)
→ I remove and/or move and/or copy parts of this sound file, regardless of the channel (= lossless)
→ Add silence (= lossless)
- output file has an equal or bigger bit-depth (but less than 32-bit float for this case) than the input file with the same sample rate + number of channels, only if:
- → I simply import/export with the same characteristics (= lossless)
→ I remove and/or move and/or copy parts of this sound file, regardless of the channel (= lossless)
→ Add silence (= lossless)
- output file is 32-bit float (whatever modifications I can make) = lossless
→ but I think dither is already disabled for the last point
Re: Sample Data Export/Import is “bit-perfect”/lossless?
Posted: Thu Oct 26, 2017 7:52 am
by steve
The 'rule' about when to apply dither is very simple:
"Apply dither when converting to less bits per sample".
Audacity does this by default.
The catch:
Audacity processes in 32-bit float format, so if the track is less than 32-bit float, then processing the track in any way will involve a conversion from the track format, to 32-bit float and back to track format. By default, Audacity applies dither during the second conversion (32 -> 16 or 32 -> 24). "Processing" does not include simple edits such as cut / paste / delete. "Processing" means anything that changes sample values.
The second catch:
Most of the exporters (the code that turns the raw audio data into an audio file) work in 32-bit float, so exporting to less than 32-bits will have dither applied by default. There are some exceptions to this: some of the lossy compressed formats (notably MP3) don't apply dither, but in this case it is not really relevant as losses due to encoding are more significant than whether dither has been applied or not.
This is all explained in the documentation:
http://wiki.audacityteam.org/wiki/Dither
Re: Sample Data Export/Import is “bit-perfect”/lossless?
Posted: Thu Oct 26, 2017 8:30 am
by Kdmeizk
I did not remember this page…
Thank you. But it does not mention the silence, and I think adding silence does not require dithering. Or it depends where the silence is added, like adding silence at the beginning and/or end of the track, so dithering is not necessary. But adding silence elsewhere than at the beginning and/or end require dithering?
Re: Sample Data Export/Import is “bit-perfect”/lossless?
Posted: Thu Oct 26, 2017 8:38 am
by steve
Adding silence does not change the values of existing samples in the track, so dither is not required.
Re: Sample Data Export/Import is “bit-perfect”/lossl [SOLVED
Posted: Fri Oct 27, 2017 11:53 pm
by Kdmeizk
steve wrote:Adding silence does not change the values of existing samples in the track, so dither is not required.
Noted. Could you please mention it in your documentation? (
http://wiki.audacityteam.org/wiki/Dither)
Example:
Here's the exception to the rule: If you have recorded in 16-bit and are only doing simple editing (cut, delete, paste, trim…)
to →
Here's the exception to the rule: If you have recorded in 16-bit and are only doing simple editing (cut, delete, paste, trim, adding silence…)
--------------------------------------------------------------------------------
Thank you very much for your answers, and your patience.
This thread is now solved, and I specified it in the thread title.
I also added the solution in my first post. Do not hesitate to change it if something is wrong/badly said.