Many .WAV files are in "ERROR: ..."

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!

I'm unclear why you think that Mp3tag should support these two fixes. There are already free programs that can repair all sorts of corruption in WAV files. From what I have read, they work very well. Have you tried them?

Fix a Corrupt Wav Audio File in Audacity - Data Recovery Using VLC

How To Repair A Corrupted Audio WAV File In Windows

The Audacity Forum is another resource:

and: