I’ve noticed now a few times that when I edit a FLAC file in Audacity 2.3.0 and export it back to FLAC, the resulting file is considerably larger than the original file. The difference is as much as 10%. It’s not due to different compression levels and it’s not due to different FLAC versions. I can take the original FLAC file and re-encode it to FLAC using foobar2000 and the size barely changes. Audacity is doing something that results in its saved FLAC files being larger. Any idea what might be going on? Thanks.
Here is the difference in size:
“Audacity Commandline FLAC 1.3.2” uses this command line:
“C:\Program Files (x86)\Codecs\flac-1.3.2\win64\flac.exe” --no-seektable - -o “%f.flac” -f
For “Audacity Commandline FLAC 1.3.2”, you’re definitely using compression level 5 because that’s what flac.exe uses it’s given a parameter to override it (“-#”, where “#” is the compression level, ranging from 0 to 8). For the others, it’s very likely that Audacity is also using 5, while Foobar2000 is using a higher value. Can you double-check which levels you’re actually using?
Another thing that may be contributing the file size is the (generally inaudible) noise that Audacity adds for dithering. Here’s an explanation on this:
Even noise this quiet will make the audio harder to compress losslessly, which increases the file size. This, combined with possibly using a lower compression level than what was used for the original file, may explain your situation.
If you want to turn off dithering, simply go to Edit → Preferences… → Quality, and in the “High-quality Conversion” section, set “Dither” to “None”.
Well, it’s the dither making the difference. Turned it off and file size is maintained. Thanks for helping with this.
Since I’m opening 16/44 and saving back to the same, there’s no point in dither (right?) I’ve never noticed it to be audible, but size-wise its impact is much larger than I’d have thought. Maybe because this track is classical and there is a lot of silence?
I’d think the default setting for dither would be “Off” except in cases of higher wordlength being saved to lower. Maybe that isn’t possible with Audacity code today, but would be nice for a future release.
Since I’m opening 16/44 and saving back to the same, there’s no point in dither (right?)
Audacity works internally at 32-bit floating. Not 16-bit. There is always a serious conversion even if you do nothing. Getting into Audacity is a snap since the quality inside is much greater than the quality outside. But Exporting a new show can cause problems.
Any change to the sound during editing can cause errors to “line up” and be audible during export.
Nobody cares about one sampling point quantizing error, but if three or more of them line up, that’s audible distortion.
I’d think the default setting for dither would be “Off”…
That’s a recipe for complaints of “mystery” errors and distortion for normal production.
Thanks, I’d forgotten this.
If you literally do nothing other than import and export, and the audio files (original and copy) are both in a lossless format (such as WAV or FLAC), then by turning dither off, the output file will be a bit-perfect copy of the original.
Well there’s the thing - in the vast majority of cases, people are using Audacity (an “audio editor”) to modify the audio before exporting it. If sample values are modified by applying any kind of effect, mixing, pan or gain change, fades, normalizing … then the (32-bit float) sample values in Audacity will not convert exactly to 16-bit values. This is what “dither” is for. Dither provides a better way of “rounding” high bit formats to lower bit formats.
Understood. In this particular case, I was simply chopping off a few seconds of silence at the head of a FLAC file. Pretty sure the dither added by Audacity would be of no benefit in this case.
As you suggested in your previous post, the way that Audacity handles dither is not ideal in all cases, but making it “ideal for all cases” is a rather complex task (and a “theoretic ideal” may not always be a “practical ideal”).
If you literally do nothing other than import and export … the output file will be a bit-perfect copy of the original.
Yes, but it’s still converting. It’s just under those conditions, the errors go away.
I still run into situations where this is confusing. Maybe changing the way it is labeled in “Preferences” would help.
Rather than “Real-time Conversion” and “High-quality Conversion”, the labels should describe what is actually happening such as “Playback” and “Export”. That way I wouldn’t need to look at the online manual every time I can’t remember what the current labels mean. Thanks.
“Real-time Conversion” is any time you are playing or recording in Audacity. This includes:
- Normal playback
- Play at speed
- Previewing effects
In short, it is any time that the conversion is done on the fly while playing or recording.
“High-quality Conversion” is used whenever converting the sample depth “off-line” (not playing). This includes:
- Mix and Render
- Mixing down stereo to mono
- Applying an effect in a situation where sample rate / format conversion is required
In short, the “High-quality Conversion” settings are used any time the sample rate / format conversion is required “except for” when converting in real time.
Normally you can leave both of these settings at their defaults (recommended).
The only time that there is any value in changing the default settings is if you are working with lossless formats, and you are not applying any processing and you are not changing the amplitude, and you are not modifying either the track Gain or Pan, and you are dealing with only one track in the project, and you are using lower than 32-bit float format, and you need the exported file to be sample accurate. In all other cases, use the defaults.
Arguably we could now remove the “real-time” settings because the resampling library that Audacity now uses is more efficient than the old one, so the default settings should work well for everyone and never need changing.
Thanks for your reply. Maybe then:
“Recording & Playback”
“Editing, Processing & Export”
I do often use Audacity in the case you described: trimming a lossless file of excess head/tail and exporting it back to lossless. I always turn dither off when doing so.
It’s a little more complex than that. In the case of recording, whether or not the real-time conversion settings are used depends on exactly how you are recording, what you are recording, and the capabilities of the sound-card drivers. In the “usual case”, Audacity doesn’t do any conversion when recording, but in “some” cases (for example, recording from Stereo Mix when the “play” source is a higher format than the recording target), Audacity “may” need to perform a conversion. IF that conversion has to be done on the fly (“real time”), then the real-time settings will be used. If the conversion can be deferred to an “off-line” conversion, then the “High Quality” settings will be used.
What it comes down to is not the specific task that is being performed, but whether that task requires a format conversion to be performed in real-time (on the fly).
Personally I think that a better approach would not concern preferences at all, but rather to provide an option in the Export dialog to disable dither.