This commit is contained in:
Arisotura 2021-08-08 15:45:44 +02:00
parent c7325469c2
commit d5a20ad3c8
1 changed files with 3 additions and 3 deletions

View File

@ -208,7 +208,7 @@ void micLoadWav(const char* name)
for (int i = 0; i < micWavLength; i++) for (int i = 0; i < micWavLength; i++)
{ {
u16 val; u16 val = 0;
switch (SDL_AUDIO_BITSIZE(format.format)) switch (SDL_AUDIO_BITSIZE(format.format))
{ {
@ -228,9 +228,9 @@ void micLoadWav(const char* name)
{ {
u32 rawval; u32 rawval;
if (SDL_AUDIO_ISBIGENDIAN(format.format)) if (SDL_AUDIO_ISBIGENDIAN(format.format))
rawval = (buf[res_pos*4] << 24) | (buf[res_pos*4 + 1] << 16) | (buf[res_pos*4 + 2] << 8) | buf[res_pos * 4 + 3]; rawval = (buf[res_pos*4] << 24) | (buf[res_pos*4 + 1] << 16) | (buf[res_pos*4 + 2] << 8) | buf[res_pos*4 + 3];
else else
rawval = (buf[res_pos*4 + 3] << 24) | (buf[res_pos*4 + 2] << 16) | (buf[res_pos*4 + 1] << 8) | buf[res_pos * 4]; rawval = (buf[res_pos*4 + 3] << 24) | (buf[res_pos*4 + 2] << 16) | (buf[res_pos*4 + 1] << 8) | buf[res_pos*4];
float fval = *(float*)&rawval; float fval = *(float*)&rawval;
s32 ival = (s32)(fval * 0x8000); s32 ival = (s32)(fval * 0x8000);