View Full Version : 2GB WAV file appears to have 0 length
mg262
15th July 2004, 11:27
A couple of days ago I set a WAV file (44.1 kHZ stereo PCM) to record using HDOgg (Hard Disk Ogg) and left my PC... when I came back much later I found that the program had crashed when the file was exactly 2 GB large. But any program that will open it (e.g. Cool Edit Pro) shows it as having 0 length.
Splitting it into bits and examining them with a hex editor seems to show that the data's there... it may be that the length field wasn't filled in in the header by the recording program. I would be really grateful if anyone can suggest a way to repair the header or otherwise extract the data...
Mohan
daphy
15th July 2004, 14:55
FAT32 or NTFS?
mg262
16th July 2004, 00:46
NTFS
johnman
16th July 2004, 02:06
if i remember correctly, the size of a wav is inside the waveheader. Since this is a 4 byte (or 32bit) number which means that the maximumsize of the wav is limited. My guess is that when the program crashed, it did NOT update the size of the file (which obviously should happen when the recording is stopped) and therefore the header is invallid (size=0). To repair the file you should manualy edit the size in the waveheader.
Now u probabely want to know how this is done??
I dont know exactly which byte it is, so u have to look it up on the net what bytes are responsible for the size.....
if you are really lazy i can take a look at the header for you and give you the correct hex values for you to edit. Just post the first +-60 bytes.
(like tyhis:
52 49 46 46 24 DC A1 00 57 41 56 45 66 6D 74 20
10 00 00 00 01 00 02 00 44 AC 00 00 20 62 05 00
08 00 20 00 64 61 74 61 00 DC A1 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
)
PS i found a link which might be interesting:
http://ccrma.stanford.edu/courses/422/projects/WaveFormat/
NB if you edit the size yourself, carefull with the big/little endian and signed/unsignde stuff.
daphy
16th July 2004, 06:46
already tried besplit to repair the header? :rolleyes:
mg262
16th July 2004, 11:06
I was about to try your suggestion when I thought of an easier way - rename the file to .pcm and open in Cool Edit - which worked great. Thanks for the suggestions, though!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.