I'm taking it back. I'm taking them all back.
November 10, 2009 5:07 AM   RSS feed for this thread Subscribe

Help me recover a corrupt .wav file by modifying the header!

I recorded something using a Marantz PMD 620, but when I copied it to my computer, it shows the length as 0:00. Apparently, this is a known issue (see the comment on the device). (See also)

So the file is perfectly good, but the header information on the length of the file is bad. I tried downloading goldwave to see if I could recover it using that, but GoldWave tells me "internal data size incorrect. The file may be corrupt."

I feel like I should be able to recover the file if I can rewrite the header. Unfortunately, I have no idea what I am doing when it comes to hex, or headers. I do have good files also recorded with the device on my computer that I can use as reference. Can you guys please hope me?
posted by orville sash to computers & internet (7 comments total)
I have had this same thing happen. I was able to fix it using the open source audio editor Audacity by opening the WAV as a "raw" file. I did need to know the specifics of the WAV file such as 48000Hz/Stereo/16-bit/signed/little-endian and it took a few tries to get it right, but by importing as RAW you will get the audio, then you can export back to a new properly formatted WAV file.

Hope this helps.
posted by arniec at 6:40 AM on November 10, 2009


here's an explanation of the wav specification
here's a comparison of hex editors

From the wav spec and your description, it sounds like you need to count the bytes in the data section of the file (starting at file offset 44) and put that number in the subchunk2size field (offset 40). Or, from the page:
== NumSamples * NumChannels * BitsPerSample/8
This is the number of bytes in the data.
You can also think of this as the size
of the read of the subchunk following this
number.
hope that helps
posted by aquafiend at 6:46 AM on November 10, 2009


Okay, so here is what appears to be a valid explanation of the wav format. Take it with a grain of salt, though, because I'm not sure that's actually what the PMD recorders use. It may or may not indicate what variation of the PCM wav they use in the manual.

Also, the place I can see you running into issues is the "Subchunk2Size" field. It's NumSamples * NumChannels * BitsPerSample/8. Except that I'm pretty sure you don't know the exact number of samples, and without the ability to open the file somewhere else, you're not going to be able to figure that out.

I did have this experience with a PMD661 - I had a file that wouldn't open correctly in Audition/WMP/Vegas/Soundforge, or any other progam, and also wouldn't play back correctly from the PMD661 - it would play up to a point, and then skip ahead. If I manually tried to seek back into the file from the next track, it would choke, and hang for a couple of minutes, and then refuse to seek into that area. Lacking any available linux machines (and dealing with a producer who was basically freaking out, and didn't want me to experiment), we ended up attempting to use scandisk, which made the file readable, but trashed all the data after the corruption. So don't do that.

On preview, certainly give arniec's method a try. If you've got Adobe Audition, you can try opening as raw in that, as well.
posted by god hates math at 6:46 AM on November 10, 2009


Thanks for your help, everyone.

I was able to open one of the corrupted files using Audacity as Arniec suggested. I haven't tried it on a large file (I'm at work, didn't bring large files with me, but that is certainly a lot easier than trying to rewrite the header! Since it plays back ok from the device, I was about to just plug the line out on the PMD into the my M-audio device and record the playback using protools, which would have been a nightmare.

I'll follow up when I get home and try opening the file in question.

-Alex
posted by orville sash at 7:36 AM on November 10, 2009


First off, make a backup copy of the corrupted file somewhere.

Take one of the good recorded files and open it in HxD (I'm assuming you're using windows). Copy the first 20 or 30 lines then open the corrupted file in HxD and paste in the part from the good recorded file. Save it and see if it will play.

Previously
posted by gregr at 7:52 AM on November 10, 2009


Just following up on this thread -

Arniec, I tried importing the raw data into audacity. There were about 3 minutes in the middle of the recording that were corrupt, but I managed to get the lion's share of the 32 recorded minutes. I'm absolutely livid that the product has this issue, and I'm wondering if there's anything I can do about it, but at least I can recover the information. Thank you everyone for your help.
posted by orville sash at 6:28 PM on November 10, 2009


One more follow up on this thread for anyone who might stumble upon it in the future. I spoke to Marantz support, and they told me that there are two things which must be done to minimize these issues:

1.) update firmware to latest version, which can be found at the device's product page
2.) They strongly recommended that we only use Lexar SD cards in their products. Considering the 8GB SDHC card I have in my PMD620 cost me about $20.00, and Lexar 8GB SDHC cards cost about $90.00, I suppose I got what I paid for. Still, this is the kind of information that should be easy to locate, and it is not. I am hoping this information will help.
posted by orville sash at 12:13 PM on November 16, 2009


« Older I use Mumble. My computer is i...   |   My husband and I want to be so... Newer »

You are not logged in, either login or create an account to post comments