Sample Data Export/Import is “bit-perfect”/lossless?[SOLVED]

Help for Audacity 2.x.x on GNU/Linux.

ImageThis forum is for Audacity 2.x.x on GNU/Linux and Unix-like operating systems.
Please state which version of Linux you are using, the exact three-section version number of Audacity from Help > About Audacity... and whether you installed your distribution's release or daily version of Audacity or compiled Audacity from source code.

Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.

Re: Sample Data Export/Import is “bit-perfect”/lossless?

Permanent link to this post Posted by steve » Wed Oct 25, 2017 10:40 pm

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.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45368
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Sample Data Export/Import is “bit-perfect”/lossless?

Permanent link to this post Posted by Kdmeizk » Thu Oct 26, 2017 12:16 am

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
Kdmeizk
 
Posts: 30
Joined: Mon Mar 20, 2017 5:28 pm
Operating System: Windows 7

Re: Sample Data Export/Import is “bit-perfect”/lossless?

Permanent link to this post Posted by steve » Thu Oct 26, 2017 7:52 am

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
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45368
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Sample Data Export/Import is “bit-perfect”/lossless?

Permanent link to this post Posted by Kdmeizk » Thu Oct 26, 2017 8:30 am

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?
Kdmeizk
 
Posts: 30
Joined: Mon Mar 20, 2017 5:28 pm
Operating System: Windows 7

Re: Sample Data Export/Import is “bit-perfect”/lossless?

Permanent link to this post Posted by steve » Thu Oct 26, 2017 8:38 am

Adding silence does not change the values of existing samples in the track, so dither is not required.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45368
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Sample Data Export/Import is “bit-perfect”/lossl [SOLVED

Permanent link to this post Posted by Kdmeizk » Fri Oct 27, 2017 11:53 pm

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.
Kdmeizk
 
Posts: 30
Joined: Mon Mar 20, 2017 5:28 pm
Operating System: Windows 7

Previous

Return to GNU/Linux and Unix-like



Who is online

Users browsing this forum: No registered users and 3 guests