Closed SirLynix closed 1 year ago
Thanks for the report. The link to that WAV file is giving me a 404 error. Can you perhaps email it to me?
That dataChunkDataSize
definitely looks suspicious (it's set to 0xFFFFFFFF from what I can tell). If I had to guess, I would says it's a malformed file like you suggest, but I'm happy to see if I can get it to work.
Sorry, wrong URL, here's the working one: https://files.digitalpulse.software/VousFumezMonsieur.wav
I tried to open it using VLC, Opera and Audacity, all three succeeded.
Thanks. I've pushed a fix to the dev branch. You able to give that a try?
This is happening because the size of the "data" and "RIFF" chunks have not been set properly in the file. It's being set to 0xFFFFFFFF like I suspected which is obviously incorrect. I had to fix this by checking for this specific situation and then calculating the size by simply reading-and-discarding until EOF, accumulating the number of bytes read as it goes (dr_wav does not support querying of the file size in it's backend). Loading invalid files like this will be slightly less efficient due to this workaround. Also, this assumes that the data goes all the way to the end of the file, which is not strictly always the case for WAV. That means if you have a similar file to this, but it's got non-audio chunks at the end of the file, you'll get glitching at the end of the sound.
Thank you for the quick fix!
Hi there!
I'm trying to load a one-second .wav (which loads fine using my browser and VLC) but it fails with weird values (max u32):
Here's my code (basically drwav_init + drwav_read_pcm_frames_s16):
Here's the .wav: https://digitalpulse.software/VousFumezMonsieur.wav
Since other .wav are loading it I expect this .wav is particular (maybe malformed), but I was thinking you would be interested by it.