Skip to content

Commit 33c5981

Browse files
authored
[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().
1 parent fffae1a commit 33c5981

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/raudio.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,9 @@ Music LoadMusicStream(const char *fileName)
14281428
{
14291429
music.ctxType = MUSIC_AUDIO_FLAC;
14301430
music.ctxData = ctxFlac;
1431-
music.stream = LoadAudioStream(ctxFlac->sampleRate, ctxFlac->bitsPerSample, ctxFlac->channels);
1431+
int sampleSize = ctxFlac->bitsPerSample;
1432+
if (ctxFlac->bitsPerSample == 24) sampleSize = 16; // Forcing conversion to s16 on UpdateMusicStream()
1433+
music.stream = LoadAudioStream(ctxFlac->sampleRate, sampleSize, ctxFlac->channels);
14321434
music.frameCount = (unsigned int)ctxFlac->totalPCMFrameCount;
14331435
music.looping = true; // Looping enabled by default
14341436
musicLoaded = true;

0 commit comments

Comments
 (0)