Jump to content

Can a damaged WAVE file be recovered? FR2 + disk error


joshneal

Recommended Posts

Hello all,

  Im a NYC based sound mixer and this is my first post on JW sound.  For this posting I am trying to figure out if I can recover a damaged wave file - heres the situation:  I was recording sound at a documentary shoot of a 25th anniversary party of a restaurant.  I had shotgun pointed at the general crowd, and a direct feed from the house board.  They were rolling intermittently for long periods of time, so I just let my Fostex FR2 roll for the whole thing only cutting and starting a new file at good breaking points (BTW there was no TC sync, or any slating which I explained to them would be a nightmare to sync, but they seemed to think it would be no problem - so that part is their headache).

  But at one point there was some issue some house equipment resulting in an incredibly loud buzz.  I immediately dove for my FR2 to cut, but just before I got to it, a disk error occurred (I roll on a 5gb pcmcia disk, not compact flash).  I dont know if this was a direct result of the buzz way overmodulating the recorder or if it was pure coincidence (ive had the disk error before).  In any case, I lost a 40 minute take of sound.  But, there is a file called FR20001 on the recorder that is about 750mb that is definitely the file I need.  Is there any way to recover the audio from that file?  I asked the guys at Pro Sound in NYC, but they didnt have a solution.  I assume that the fr2 creates a temp file called fr20001 while recording is in progress and then completes the file and names it when recording is stopped.  So this file is just missing whatever the final "bookend" of a wave file is to make it readable.

  Can anyone help???  If you can help me get this file back I will forever in your gratitude.

Thanks

Josh Neal

http://www.joshuabrentneal.com

Link to comment
Share on other sites

Hello all,

  Im a NYC based sound mixer and this is my first post on JW sound.  For this posting I am trying to figure out if I can recover a damaged wave fileThanks

Josh Neal

http://www.joshuabrentneal.com

Courtney, if you're around, seems like you might be able to shed some light on this.

-  JW

Link to comment
Share on other sites

It May be able to be recovered but you need to know more about the file's structure.  Does the file show up in the directory? Can you copy the file to another Disk?  IF you can, try to make sure the file is named correctly (with .wav as a filename extension).  You can then use any hex file viewer and check out the file header to see if it is a proper formated wav file.  If you have a PC you can use BWF-Widget Pro (demo version) to see if the file will play or check to see if it has all the required chunks using the View Raw Data button. 

The FR2 files usually contain 6 chunks; bext, fmt, elmo, data, cue, LIST  In that order.  If you can't find all the chunks in the header (especially the "data" chunk the file may not be recoverable without a lot of work with a hex editor.

To learn more about file structure check out the BWF documentation online at EBU's Website

http://www.ebu.ch/en/technical/trev/trev_274-chalmers.pdf

Here is what the start of a BWF file from an FR2 should look like in a HEX viewer like AXE.

After you look at the file and see if it has all it's chunks you may be able to load it in applications like Audacity.   Some editing programs can load partial files if there is a proper header, but truncated data etc.

---Courtney

post-238-130815073596_thumb.jpg

Link to comment
Share on other sites

Thanks to Courtney's help I was able to recover the entire (what turned out to be) hour and ten minute take of sound.  I basically had to manually enter the information for each of the first four chunks of data - bext, fmt, elmo, data.  I just referenced another file and borrowed the common information.  The most challenging part was getting the file to play completely.  I took me a while to figure out how to make the player know how long the data section was - I determined the hex value for the total number of bytes in the file and entered that as the next four bytes after the "data" chunk.  This effectively makes the player think that the length of the audio is a the size of the entire file (overshooting a bit because the other chunks take up some space at the beginning).  But this doesnt make a difference - it plays until the end.  Mad props to Courtney for saving my ass!

Peace

Josh

Link to comment
Share on other sites

  • 11 years later...

Hi everyone.

This post guided me in successful restoration of a recording that was damaged due to power failure. I had the recorder plugged in near where the guys running the lights were plugged in, and they pulled every plug before I got to stop the recording. When I powered the unit back up, I saw a file there but it would not play back. I immediately shut the unit down and removed the card, then began to search for solutions. I didn't know much about this, but I knew that allowing anything to attempt to write to the card would be detrimental to any sort of file recovery. The recording I lost was preceded by another which I ended because the battery pack I was using to run the FR2 was nearly expired. The above posts led me into research which ultimately guided me to the solution to recover the file, and I will summarize this research here for the benefit of others.

 

First and foremost, I am not recovering from a damaged disk. This is resultant of a power failure during recording. This procedure may or may not be of assistance for other types of failure, and is applicable to WAV files.

 

If this happens to you, you must do two things before changing anything around with your recorder. 

1. REMOVE THE CARD AND DON'T PUT IT BACK until you're done with recovery!

2. Install a DIFFERENT card in the recorder and record a short file. It does not need to have any content, but does need to have the same exact settings regarding bits/sample and samples/second. Stop the recording and allow the recorder to finalize the file normally.

 

Using your computer, download a hex editor, and familiarize yourself with the structure of the WAV file. I found this website very informative:

http://soundfile.sapp.org/doc/WaveFormat/

 

The hex editor that I used is HxD. It is freeware and is very powerful. I had tried Frhed but it has trouble opening large files. I did use Frhed to save an exact (raw, complete) image of the flash card on my hard drive. This is probably not necessary but since I was working blind I decided that it would prevent me from screwing up the original. HxD is capable of the same, and it can open an entire disk at once. This IS necessary. Since I lack familiarity with other editors, I will use HxD for this write-up.

 

I chose to make a second copy of the image as a working copy. This way if I screw it up I simply delete it, and make a new copy.

 

As far as I can tell, the FR2 makes a file as a place holder and then begins dumping raw data on the disk immediately following it. If you had pre-record enabled, the sound data for the pre-record would go right after the place holder file, but it was held in RAM and is not recoverable if the recording is not properly finalized. The chunk of data allocated for this will be all zeros.

 

Now open the entire disk (or disk image) in HxD. Using the "find" tool, search for hex value "00 00 00 00 00 64 61 74 61 00 00 00 00". This should take you right to the place holder file. Right after the characters you should see a bunch of gibberish (or a bunch of "...." if you had pre-record enabled).

 

If you had pre-record enabled, place your cursor within the 00's following "data". Search for a hex value other than zero. I used FF. This should get you in the ball park but you may need to scroll up from there to find the beginning of the data. 

 

Where the 00s end and the gibberish begins, congratulations, you've very likely found your data. Place your cursor on the first byte of the data. Jot down the offset indicated at the lower left of the screen. 

 

Now start a search for 6 bytes of zeros ("00 00 00 00 00 00"), searching forward from your current offset. This should take you to the end of the data as it's pretty unlikely that you'll have that many consecutive zeros within the data. Place your cursor on the last non-zero character and again note down the offset.

 

Next we need to select the data chunk. Use Edit > Select Block. For beginning, type in the hex value of the first character of the data. Enter the offset of the last character of the data as the end of the selection. Jot down the length of the chunk in hex. It is displayed on the lower information bar of HxD. Circle this number as you will need it shortly.

 

Choose File > Save Selection... and save the selection as something you'll remember. I used data.bin

 

Now we need to open the audio file you recorded using the different memory device. We'll fetch a header from this and use it to complete the WAV file.  Open it using HxD.

 

Explore the beginning part of the file. As you scroll down, you will eventually get to the beginning of that gibberish we saw before, and you should see "data" at the beginning if you look carefully. Put your cursor on the FOURTH BYTE following "data". Jot down the offset.

 

Edit > Select Block. Begin at zero and end at the offset you just wrote down. Save this selection as before. I used "header.bin".

 

Add hex "10 00" to the number circled. I am using the "programmer mode" in the Windows 10 calculator. Jot this sum down.

 

Open your "header.bin" file in HxD. The first characters are RIFF followed by four characters of gibberish. You need to replace the hex values for these characters with the sum you just calculated, but it goes in sort of backwards. Let's say your sum was 01 23 45 67. You would enter 67 45 23 01 following "52 49 46 46" (RIFF in hex). 

 

Now locate "data" at the end of your file. You should see four characters of gibberish after it. In the same backwards fashion as above, enter the number you circled in place of those four bytes. 

 

Don't close the header. Open the data.bin file as well.

 

Go to Tools > File Tools > Concatenate

 

Assemble the header file first then the data file. Save this as a .wav file. I used "recovered.wav".

 

You should now be able to open the file in an audio player. If you just hear static, read a little about the file structure in the website I mentioned above. You may need to put some zero bytes at the beginning of the data chunk in order to bring everything into alignment. For me, this worked on the second shot.

 

Hope that one day this helps someone :)

 

 

Link to comment
Share on other sites

  • 3 weeks later...

if there is only the header broken/ not written, there are some software tools you can try, some years ago there was a pro Tools version that left you with unreadible wav files after closing the session, there was a smart little app that repaired the header...

i think it was wav fixer, maybe this one:

 

http://www.railjonrogut.com/downloads/WavFixer.dmg.zip

 

worth a try with a copy of the file

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...