Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[raudio] Add 24 bits samples support for FLAC format #4058

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

rexim
Copy link
Contributor

@rexim rexim commented Jun 12, 2024

If you enable SUPPORT_FILEFORMAT_FLAC some FLAC files don't play correctly. Specifically with sample size 24 bits. Here is a small example to reproduce the bug flac_bug.zip. The song sounds choppy.

I looked around the source code and found that WAV hardcodes the conversion of 24 bits samples to 16 bits ones. So I applied the same approach to FLAC and it seems to fix the issue. Submitting it as a PR in case it's useful for anybody else.

Please let me know if this is not the right way to do that.

Similarly to how it's done for WAV format, by forcing the conversion
to s16 on UpdateMusicStream().
@raysan5 raysan5 merged commit 33c5981 into raysan5:master Jun 12, 2024
14 checks passed
@raysan5
Copy link
Owner

raysan5 commented Jun 12, 2024

Hi @rexim! Thanks for the review! Actually, I didn't remember that LoadAudioStream() supported that conversion!

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.

2 participants