Why does audacity convert 16 & 24bit files to 32bit float?

I’ve read through some other posts and articles regarding this question, however there’s still a few things i dont quite understand.
Like what exactly happens when audacity upsamples these files to 32bit?
People say it’s better and more ‘accurate’ to edit files at 32float, but how does that even make sense if i open a 24bit file. Isnt upsampling it just adding extra 0s? If i export that file to 32bit there isnt gonna be more audio information on it.
And for example if i open a 16 bit file and then export it again to 16 bit, isnt audacity gonna introduce unnecessary dither if it downsamples it again from 32bit?
For context, im mostly just resampling and downsampling files for CD burning.

It’s a little more complex than that, but basically yes, just padding.

Where that upsampling becomes important is when you start working on the audio.

Example:
Say that you have 16-bit audio data, containing sample values:
0, 1, 2, 3, 4
and you amplify by -2 dB.
-2 dB = a scale factor of 0.794328
so your output samples should be:
0, 0.794328, 1.588656, 2.382984, 3.177312
but 16-bit integer only has whole number values, so the sample values will be rounded to:
0, 1, 2, 2, 3
Now say that you amplify by +6 dB (a scale ratio of 1.99526
The sample values now become:
0, 2, 4, 4, 6
Notice that the rounding errors are growing significantly bigger.

By processing with virtually exact 32-bit float values, and then converting back to 16-bit at the end, the rounding errors are minimised and do not accumulate.

And for example if i open a 16 bit file and then export it again to 16 bit, isnt audacity gonna introduce unnecessary dither if it downsamples it again from 32bit?

Yes, there is the possibility of unnecessarily dithering, or dithering multiple times. You can optionally disable dither if you wish.

The developers are looking into automatically disabling dither when dither is unnecessary. The technicalities involved make this quite tricky to implement, but it is certainly possible to do.

Sorry for the late reply, i was quite bussy the last few days. I’ve also watche this video by Dan Worrall: https://youtu.be/2iDrbgfPjPY

Okay so editing in 32bit is preferable because rounding errors are more precice. So for my case i’m better off downsampling my 24bit files from audacitys 32bit float, since they end up as 16bit files.
However i’m still unsure regarding the 16 bit file. Since they are already 16bit i should turn off dither before resampling the samplerate and exporting. But if i do that am i then gonna have the quantization noise from audacitys up- and downsampling to and from 32bit float, or does floating point work differently in that regard?
If not, basically my options are setting audacity to open 16bit files as 16bit and work like that, or resampling them as 32 bit and then export with added dither?

Don’t do that. That’s the worst of all options as it can cause Audacity to add dither multiple times.

The simplest approach is to just leave Audacity’s sample format and dither options at their default settings. In the worst case, this may unnecessarily add a tiny bit of noise, which is likely to be insignificant.

If you want to do things “technically perfect”, then there is exactly ONE situation when dither should be disabled:

If your input audio is 16-bit or 24-bit, and your exported file is exactly the same format as the input file
AND
you are not applying any processing of any kind to the audio.

“Cut / delete / copy / paste / trim” do not count as “processing”, they are just “edits”.
“Fade / Amplify / Normalize / Noise Reduction / Equalization / and just about everything else” DO count as “processing” and dither should be enabled for best sound quality.

It is best to import as 32-bit float in all cases.
It is best to use dither in all cases except for the one case described above, but even for that one case it doesn’t matter much if dither is applied.

Thank you, that is exactly what i was looking for! And dreading at the same time. :mrgreen:
Guess i’ll go and redo around 3000-4000 files as soon as it gets colder inside again. At least i’m gonna be a lot faster this time, since now it’s just importing and exporting for most files.

Before you do that, listen to some of them and decide if you actually need to do anything. There’s a good chance that there’s no problem with them.

editing in 32bit is preferable because rounding errors are more precice.

I think you’re being a little too “gentle tinkering around the edges” about this.

32-floating doesn’t overload. If you apply an effect, filter, process, or correction that causes the timeline waves to exceed 100%, that’s the end of those waves. They’re clipped, distorted, and permanently damaged in 16-bit. In 32-floating, the good quality work louder than 100% is still up there waiting for you to decide what to do.

For one real-world example, we publish an Audiobook Mastering Suite which sets overall loudness of your chapter reading and doesn’t pay any attention to the tips and peaks of the waves. Then it runs an effect which gently brings tips and peaks back down into conformance whether some pieces were in overload or not.

You just don’t have to think about it. You can pull that off in plain 16-bit, but it’s not fun, and it can give you those rounding and quality errors.

Koz

Before you do that, listen to some of them and decide if you actually need to do anything. There’s a good chance that there’s no problem with them.

No they all sound fine, i’ve been listening to them for the past 2 years. It’s really just to satisfy my perfectionism. And it’s gonna be a fun weekend project.