Skip to content

fix: Handle 32bit FLAC files - #9121

Merged
kryksyh merged 3 commits into
audacity:audacity3from
gekkonid:fix-flac32
Jul 24, 2025
Merged

kryksyh merged 3 commits into
audacity:audacity3from
gekkonid:fix-flac32

Conversation

@kdm9

@kdm9 kdm9 commented Jul 23, 2025 •

Copy link
Copy Markdown
Contributor

Thanks for all your work such a fantastic tool!

This PR resurrects & extends #6638, to solve #6606, namely the inappropriate conversion of 32bit PCM FLAC files to floating point tracks.

We handle this by promoting 24/32bit FLAC files to floating point tracks, doing the int->float during import of each frame.

This fixes #6606 for me, though I am still testing on more sample data, and comparing to external conversion with ffmpeg to check.

This should port pretty nicely to AU4, so once you are happy with this I can make a separate PR for AU4/main branch.

Resolves: #6606

  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

Ressurects audacity#6638, to solve audacity#6606.

We handle this by promoting 24/32bit FLAC files to floating point
tracks.

I believe this fixes audacity#6606 for me, though I am still testing on more
sample data, and comparing to external conversion with ffmpeg to check.
@LWinterberg

Copy link
Copy Markdown
Member

Ohey, so my thinking wasn't entirely wrong!

@kryksyh
kryksyh changed the base branch from release-3.7.4 to audacity3 July 23, 2025 11:38
channel.AppendBuffer((samplePtr)buffer[chn],
int24Sample,
auto tmp = ArrayOf<float>{ frame->header.blocksize };
// handles both 24/32bit PCM. Divide by 2^n-1 to form -1-1 scaled floats

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kdm9 is there a specific reason you chose to convert 24bit to float?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess not, I've reverted this in the latest commit.

@kryksyh kryksyh linked an issue Jul 23, 2025 that may be closed by this pull request
@kryksyh
kryksyh merged commit 21e9819 into audacity:audacity3 Jul 24, 2025
kdm9 added a commit to gekkonid/audacity that referenced this pull request Jul 27, 2025
This commit is audacity#9121 ported to
the upcoming AU4 main branch.
@kdm9 kdm9 mentioned this pull request Jul 27, 2025
5 of 6 tasks
kryksyh pushed a commit that referenced this pull request Jul 30, 2025
This commit is #9121 ported to
the upcoming AU4 main branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error on opening 32-bit FLAC

3 participants