Explorar el Código

[raudio] Support 24-bit FLACs in `LoadMusicStreamFromMemory` (#4279)

Force conversion to 16-bit, same as how it is done in `LoadMusicStream`.
This fixes the problem where 24-bit FLACs play silence or broken sound.
pull/4282/head
konstruktor227 hace 6 meses
cometido por GitHub
padre
commit
b0c3013b51
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: B5690EEEBB952194
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. +3
    -1
      src/raudio.c

+ 3
- 1
src/raudio.c Ver fichero

@ -1626,7 +1626,9 @@ Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data,
{
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;

Cargando…
Cancelar
Guardar