WAV file rebuild - part fixed myself

Hi and thanks in advance. I’m a university tutor , using Windoes 10 and Audacity 3.0.4

As part of some work we were doing , I recorded a number of very long WAV files (still within the size limit). One of them came back without a header file . I tried to import the Raw data using Audacity and got the typical results of lots of white noise and not much else. Ive spent the week learning about header files, and Hex editors.

I took the details of a working WAV file from the same device. Heres the screen shot of the working file
I copied the header file details using the Hex editor into the non working file. I edited the file size in positions 4 -7 (in Hex, file size in bytes minus 8). I hope ive done that bit right. All the rows of zeros were in the working file header, so I didnt mess with them. Heres the screen shot


I have read that I also need to change the size of the subchunk (directly after the word “Data”), but am struggling to work out what I need to put there.

With the new header file as it now stands, the wav will play, and I can sort of hear the recording…but its behind a lot of “noise” and not descernable other than that it is voices. Speed seems about right. Ive read somewhere that there is an “offset” or something where Audacity (or any other player) is not “aligned” with the data part of the file, and so throws in the noise as its interpretation of the data.

I feel I am almost there recovering the work, but just need a bit of help to get over the finishing line. Many thanks if you are able to help. It’s much appreciated.

Your best option is to import the raw data and re-save the WAV. But you’re “guessing” some of the parameters wrong (probably/hopefully just the offset).

If the playing time is correct you know you’re “close” with the parameters.

If you have a 16-bit file an offset of 0 or 1 should work (or any odd or even number… two bytes per sample). If it’s 24-bits it can be 0, 1, or 2. If it’s stereo the left & right might be interchanged but you can fix that in Audacity (if you can tell and if it’s important). The offset is supposed to be 44 bytes where the header ends but it looks like your file is corrupt.

If the sample rate is wrong you’ll get the wrong speed (and the wrong playing time). If you get the number of channels wrong that will also give you the wrong speed. The wrong bit depth will give you scrambled audio and the wrong speed.

Of course, when you import raw data the header will be read as audio so you’ll have to edit-out the glitch/noise at the beginning.

If the file is some “oddball” format you might be out-of-luck but if it’s regular linear PCM like a standard WAV file, and if the actual audio data isn’t corrupted, importing the raw data WILL WORK as long as you get the parameters right to re-assemble the bytes into samples.

Thank you for the info and assistance. Its got me a bit closer. Definitely got the length and speed right now, but still lots of noise over the main audio making it unuseable. I’ll keep trying different settings and hope for the best. Many thanks.