diff options
| author | Alexey Kutepov <[email protected]> | 2024-06-12 16:42:41 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-06-12 11:42:41 +0200 |
| commit | 33c598123c4b6ef78ff2ac3dcc1094da4dd6efef (patch) | |
| tree | 42753b68e2a6683e8e606f7733116b439e460be4 /src | |
| parent | fffae1a975dbfff8e6c8ee37c989f5256debc90f (diff) | |
| download | raylib-33c598123c4b6ef78ff2ac3dcc1094da4dd6efef.tar.gz raylib-33c598123c4b6ef78ff2ac3dcc1094da4dd6efef.zip | |
[raudio] Add 24 bits samples support for FLAC format (#4058)
Similarly to how it's done for WAV format, by forcing the conversion
to s16 on UpdateMusicStream().
Diffstat (limited to 'src')
| -rw-r--r-- | src/raudio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/raudio.c b/src/raudio.c index c6bd0016..177bdb5a 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1428,7 +1428,9 @@ Music LoadMusicStream(const char *fileName) { music.ctxType = MUSIC_AUDIO_FLAC; music.ctxData = ctxFlac; - music.stream = LoadAudioStream(ctxFlac->sampleRate, ctxFlac->bitsPerSample, ctxFlac->channels); + int sampleSize = ctxFlac->bitsPerSample; + if (ctxFlac->bitsPerSample == 24) sampleSize = 16; // Forcing conversion to s16 on UpdateMusicStream() + music.stream = LoadAudioStream(ctxFlac->sampleRate, sampleSize, ctxFlac->channels); music.frameCount = (unsigned int)ctxFlac->totalPCMFrameCount; music.looping = true; // Looping enabled by default musicLoaded = true; |
