Browse Source

[raudio] fix mapping of wave data in LoadWaveSamples() (#4062)

Co-authored-by: Listeria monocytogenes <listeria@disroot.org>
pull/4065/head
listeria 7 months ago
committed by GitHub
parent
commit
df849d2fb0
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/raudio.c

+ 2
- 2
src/raudio.c View File

@ -1304,8 +1304,8 @@ float *LoadWaveSamples(Wave wave)
for (unsigned int i = 0; i < wave.frameCount*wave.channels; i++)
{
if (wave.sampleSize == 8) samples[i] = (float)(((unsigned char *)wave.data)[i] - 127)/256.0f;
else if (wave.sampleSize == 16) samples[i] = (float)(((short *)wave.data)[i])/32767.0f;
if (wave.sampleSize == 8) samples[i] = (float)(((unsigned char *)wave.data)[i] - 128)/128.0f;
else if (wave.sampleSize == 16) samples[i] = (float)(((short *)wave.data)[i])/32768.0f;
else if (wave.sampleSize == 32) samples[i] = ((float *)wave.data)[i];
}

Loading…
Cancel
Save