IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
repair broken wav file
clipperer
post Oct 15 2009, 00:17
Post #1





Group: Members
Posts: 3
Joined: 15-October 09
Member No.: 74027



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!
Go to the top of the page
+Quote Post
DVDdoug
post Oct 15 2009, 02:46
Post #2





Group: Members
Posts: 2676
Joined: 24-August 07
From: Silicon Valley
Member No.: 46454



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. 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! wink.gif

You can find the WAV spec at wotsit.org. 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...

Go to the top of the page
+Quote Post
clipperer
post Oct 15 2009, 04:34
Post #3





Group: Members
Posts: 3
Joined: 15-October 09
Member No.: 74027



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.
Go to the top of the page
+Quote Post
DVDdoug
post Oct 15 2009, 07:06
Post #4





Group: Members
Posts: 2676
Joined: 24-August 07
From: Silicon Valley
Member No.: 46454



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.
Go to the top of the page
+Quote Post
2E7AH
post Oct 15 2009, 07:41
Post #5





Group: Validating
Posts: 2424
Joined: 21-May 08
Member No.: 53675



Maybe even easier would be with Peter's WinRipper
Go to the top of the page
+Quote Post
clipperer
post Oct 15 2009, 07:58
Post #6





Group: Members
Posts: 3
Joined: 15-October 09
Member No.: 74027



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

This post has been edited by clipperer: Oct 15 2009, 07:59
Go to the top of the page
+Quote Post
Kees de Visser
post Jul 19 2012, 18:13
Post #7





Group: Members
Posts: 717
Joined: 22-May 05
From: France
Member No.: 22220



"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 smile.gif
Any tricks to bump the google rating ? Usually hydrogenaudio threads rank very high.

Thanks again DVDdoug !
Go to the top of the page
+Quote Post
Rixsta
post Aug 7 2012, 12:32
Post #8





Group: Members
Posts: 4
Joined: 7-August 12
Member No.: 102080



QUOTE (clipperer @ Oct 15 2009, 00:17) *
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.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 27th November 2014 - 20:59