Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 2606 - Imported tracks should not have less bit depth than Quality Preference
Imported tracks should not have less bit depth than Quality Preference
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: Formats
3.0.0
All All
: P3 RepeatableAll
Assigned To: Default Assignee for New Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-12-02 16:34 UTC by Steve Daulton
Modified: 2021-01-02 09:24 UTC (History)
7 users (show)

See Also:
Steps To Reproduce:
1. Default Preferences (default sample format = 32-bit float) 2. Import an MP3 using FFmpeg importer 3. Observe that the file is imported as a 16-bit track Note that this is just an example. There are six importers: FFmpeg FLAC MP3 OGG PCM Raw FFmpeg and MP3 have the problem. If lossless import requires more bits than the preference (such as, 24 or 32 when preference is 16), the preference is overridden, in the others. This is desired for all. The last two choose either 16 bits or float, but never 24 bits, even when 24 bits are adequate: we don't consider that a bug.
Release Note:
Some Imports may create 16-bit tracks even when Quality Preferences set to 32-bit float. Workaround: If an imported file has the wrong sample format, change it in the track dropdown menu.
First Git SHA:
Group: ---
Workaround:
Closed:
petersampsonaudacity: Test‑OK‑Win+
petersampsonaudacity: Test‑OK‑Mac+
stevethefiddle: Test‑OK‑Lin+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Daulton 2020-12-02 16:34:19 UTC
Even when "Preferences > Quality > Default Sample Format" is set to 32-bit float (default), some file imports will create tracks with less than 32-bit float samples.

Example: Import an MP3 with the FFmpeg importer. Creates a 16-bit track.

It is however OK for an imported track to have a greater bit-depth than the Prefs default. For example, importing a 24-bit WAV file when the default quality is 16-bit, the file format should override the default and create a 24-bit or 32-bit float track (conversion from 24-bit to 32-bit float is lossless).
Comment 1 Paul L 2020-12-03 12:13:35 UTC
Steve, please tell me whether you agree with my additions to steps to reproduce.
Comment 2 Steve Daulton 2020-12-03 12:44:40 UTC
(In reply to Paul L from comment #1)
I don't see the problem with the MP3 importer on Linux. I only see the problem with MP3 files if I force Audacity to use the FFmpeg importer (libav) rather than libmad.

The easiest way to coerce the use of FFmpeg is to select the "FFmpeg compatible files" filter in the Import dialog.
Comment 3 Steve Daulton 2020-12-03 12:48:32 UTC
I recall that OGG was fixed a while back.

It seems that (on Linux) the problem only occurs when using the FFmpeg importer. I don't know if that's the same on all platforms.
Comment 4 Paul L 2020-12-03 18:04:42 UTC
(In reply to Steve Daulton from comment #3)

Closer study of the code shows you are right about OGG, also FLAC

But FFmpeg is wrong, and also MP3 always uses the Quality preference format -- which is wrong, not consistent with PCM does, overriding the preference and using a wide enough format to be non-lossy.  MP3 needs to import as float always, because libmad uses a 32 bit fixed-point format: wider than 24 bits.
Comment 5 Paul L 2020-12-03 19:23:25 UTC
Fixed at f4f8194dc67deecf24dd30e3caa605a5eb5df725

Incidental changes to OGG and FLAC -- they now never make 24 bit tracks even if that is the preference.

This makes all importers consistent with what PCM and Raw import do.
Comment 6 Steve Daulton 2020-12-04 05:30:07 UTC
(In reply to Paul L from comment #4)
> MP3 needs to import as float always, because libmad uses a 32 bit
> fixed-point format: wider than 24 bits.

Although most MP3 files are representing 16-bit data, I agree that this is technically correct.
Comment 7 Peter Sampson 2020-12-05 09:22:06 UTC
Testing on W10 with Audacity 3.0.0 a675b59

This now works properly, importing the MP3 as 32-bit

I also tested against 2.4.2 and earlier versions of 3.0.0 alpha and it failed on those, importing the MP3 as 16-bit
Comment 8 Peter Sampson 2020-12-05 09:25:32 UTC
Tested on macOS 11.0.1 Big Sur with Audacity 3.0.0 a675b59

The same good results as on W10
Comment 9 Peter Sampson 2020-12-05 09:32:21 UTC
I find the checkbox at the top of the Extended Import Prefs confusing


a) it's checked "on" by default

b) you have to turn it "off" in order for the Extended Import rules to take precedence over normal import.

The wording is far from clear - I had to make a very careful reading of the Manual page to grasp this as I was testing
Comment 10 Steve Daulton 2021-01-02 09:24:28 UTC
Now tested on all platforms.
Resolved.