WohlSoft / SDL-Mixer-X

SDL Mixer X (Or "MixerX" shortly) - An audio mixer library based on the SDL library, a fork of SDL_mixer
https://wohlsoft.github.io/SDL-Mixer-X/
Other
100 stars 24 forks source link

Error when attempting to play .WAV files exported with the popular PS2 audio extracting program MFAudio #73

Open TheEeveeLovers opened 7 months ago

TheEeveeLovers commented 7 months ago

I haven't got a chance to test this on the official SDL_Mixer, only Mixer_X, but I have also tested this in two different versions of pge_musplay and still ran into the problem. The error in question: Couldn't read 61 bytes from WAV file Some investigation has led me to believe this is caused by MFAudio's signature at the end of each file, which is indeed 61 bytes long image Removing the signature causes the file to play fine with no issue whatsoever

Anyways, here are some files so you can test on your end: BASELINE - SLIPKNOT - POD

Wohlstand commented 7 months ago

Lemme debug this thing... Looks like weird one...

Wohlstand commented 7 months ago

Actually, chunk has wrong size: Снимок экрана от 2023-11-21 07-57-29

It asks 61 byte, but actually, there is 53 bytes written: Снимок экрана от 2023-11-21 07-57-38

As my debugger tells: Снимок экрана от 2023-11-21 07-57-55

So, technically, these WAV files considered being invalid because chunk size is longer than it stores actually. These files can be fixed by changing the chunk size value into correct value: Снимок экрана от 2023-11-21 08-01-13

Wohlstand commented 7 months ago

I see, the MFAudio utility is actually very old and didn't updated for a while (I may guess, author won't fix this bug). However, I could make a workaround to don't invalidate the file when it reaches the end.

Wohlstand commented 7 months ago

Just now, I added a workaround, should work now.