Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: repair broken wav file (Read 13641 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

repair broken wav file

hey.
i managed to delete a wav file that i needed, then got it back with uneraser program but it didnt open. i opened it in notepad and saw that wav file content got mixed up with error logs etc. i then deleted the content that seemed unusual for wav files, replaced the start and end of a file with start and end of a working wav file and managed to open the file as raw in audacity and resave but the sound is still distorted and noisy. the wav file content is still there i just need a way sort it out.
does anybody know how to clear up the wave file content with programs or manually?

thanx!

repair broken wav file

Reply #1
This could be tough, but it might be possible...  A regular WAV file is simply a header followed by sequence of bytes.  What's the format (bit depth and number of channels)?

You can directly view and edit any file with a Hex Editor[/color].  Are you feeling brave (or desperate)?  I assume I don't have to tell you this, but Make a backup before you start messing around with a hex editor!

You can find the WAV spec at wotsit.org[/color].  You don't need to fully understand the spec, but it would be a good idea to take a look at it.

A 16-bit stereo file has 4 bytes per stereo-sample.  If some data has been lost so that you start reading the 4-byte sequence at the wrong point, the data will be scrambled. 

The data in a 16-bit stereo file is organized like this:  Left channel least significant byte, Left channel most significant byte, Right channel least significant byte, Right channel most significant byte.   

So, if the "starting point" is wrong, two things can happen.    If you're "lucky", you'll start by reading right channel data instead of left channel data, and the channels will be mixed-up... no big deal...  But, if you're unlucky, you'll be reading the most significant byte when you think you're reading the least significant byte, and then you'll read the least significant byte of the other channel when you think you're reading the most significant byte of the 1st channel, etc.  This is going to sound like noise!

If you simply insert a byte (with a value of zero) immediately following the header, this might fix the file.  This is going to make the flie one byte longer and the "file size" in the header will be wrong, but hopefully Audacity can still open the file.


... The bad news is, I'm getting interrupted and I have to sign-off for a few hours.  I'll try to get back to this later and give some help with the hex editor...


repair broken wav file

Reply #2
the file is 24 bit. i seached the file for "riff" and"wave" and "fmt" but didnt find any, i assume this is the header information. i also assume that the file is corrupt at its start ~15% because thats where i can read words from error log, the following seems like a regular wav file data compared to other wave files.
im feeling brave, but i dont understand hex at all yet.

repair broken wav file

Reply #3
OK, I'm back...

Since the file is 24-bit you may have to shift the data by one or two bytes to get it aligned.  (There are 8 bits per byte, so you have 3 bytes per sample (per channel). 

I've been experimenting with XVI32 and Audacity (I normally use GoldWave) and I found a much  easier way to deal with data-shift!  (I'm using Audacity 1.3.9)

With Audacity, File -> Import -> Raw Data.  Click on the file and when the dialog box opens-up you'll see Start offset. Try values of 0, 1, and 2.  If I've diagnosed the problem correctly, one of those choices should work.  (The left & right channels might be mixed-up, but I assume Audacity has an easy way to swap channels.)

Quote
i seached the file for "riff" and"wave" and "fmt" but didnt find any...
After saving in Audacity, a new header should be written, and you should definitely see those near the beginning of the file.

repair broken wav file

Reply #4
Maybe even easier would be with Peter's WinRipper

repair broken wav file

Reply #5
DVDdoug it worked!!!!!!!!!!!!!!!!!!!!!!!!!!111 thanx so much! it was all about the start offset.

repair broken wav file

Reply #6
"missing jaw drop icon" that simple ? !

Yesterday we lost almost one hour of precious studio time trying to repair a corrupted ProTools wav file.
If only this thread would have appeared on google's top page, it would have saved us quite some time
Any tricks to bump the google rating ? Usually hydrogenaudio threads rank very high.

Thanks again DVDdoug !

repair broken wav file

Reply #7
hey.
i managed to delete a wav file that i needed, then got it back with uneraser program but it didnt open. i opened it in notepad and saw that wav file content got mixed up with error logs etc. i then deleted the content that seemed unusual for wav files, replaced the start and end of a file with start and end of a working wav file and managed to open the file as raw in audacity and resave but the sound is still distorted and noisy. the wav file content is still there i just need a way sort it out.
does anybody know how to clear up the wave file content with programs or manually?

thanx!


If you try to open a file like this in "sound forge"  select raw in the drop down list, choose the sample rate and bit depth you recorded it at if you can remember, then try to open the wav file as raw.
possibly could help.