Two categories of issues:
- ERROR: RIFF data size X differs from adjusted file size Y; ID3…
- ERROR: Unsupported format or corrupted file;
After using a hex editor, the causes:
- for 1st, RIFF chunk size does not include the ID3 tags after ‘data’
- for 2nd, JUNK chunk size is 1024, but in reality it’s 1025 in hex-editor
I wrote a very naive WAV parser in C# to try read them, with a little trick:
Whenever a chunk ID starts with \0, I count them, skip that many bytes from original chunk header position; then try to read the chunk header again.
That works fine as far as I can tell, all chunks are fully read.
Maybe you could try to do the following?
- fix RIFF header size so it accounts to anything after ‘data’
- friendly header reading, try read it again starting a bit further (3 bytes max)
I can provide you a bunch of faulty WAVs if you want to try address these issues.
Thanks!