Become a Site Supporter and Never see Ads again!

Author Topic: Homegrown WAVE header repair utility  (Read 49389 times)

0 Members and 1 Guest are viewing this topic.

Offline marksk

  • Trade Count: (0)
  • Taperssection Regular
  • **
  • Posts: 119
  • Gender: Male
Re: Homegrown WAVE header repair utility
« Reply #135 on: May 08, 2012, 11:03:53 AM »
wanted to say thank you!!!! this saved my recording from saturday night!

Offline rigpimp

  • Trade Count: (13)
  • Taperssection All-Star
  • ****
  • Posts: 1480
  • Gender: Male
  • Jarts don't kill people!
Re: Homegrown WAVE header repair utility
« Reply #136 on: April 06, 2013, 02:35:16 AM »
Here I am again, searching for Gordon's wav repair tool...again.  This has saved my ass a bunch of times and tonight was no exception. 

A bump for Gordon's genius.
Mics: Schoeps MK5 G MP, Schoeps CCM 4 Lg MP, Schoeps MK8 MP, nBob cables > PFA, KCY 250/5 > PFA
Pre/A>D/P48: Sonosax SX/M2, Sonosax SX/M2-LS, E.A.A. PSP-2, Naiant Tinybox, Neumann BS48i-2 (for sale)
Recorders: Sound Devices Mixpre-6, Sony PCM-M10

http://archive.org/bookmarks/kskreider

Offline live2496

  • Trade Count: (6)
  • Taperssection Member
  • ***
  • Posts: 673
    • Gidluck Mastering
Re: Homegrown WAVE header repair utility
« Reply #137 on: April 06, 2013, 11:12:38 PM »
Thank you for the kind words. Glad you are finding the program useful.

Gordon
oktava mc012 or dpa4060 > mic2496 > pdaudio
mackie cr1604 > rme multiface > lenovo laptop

Offline it-goes-to-eleven

  • Trade Count: (57)
  • Needs to get out more...
  • *****
  • Posts: 6702
Re: Homegrown WAVE header repair utility
« Reply #138 on: April 07, 2013, 10:07:15 AM »
Here I am again, searching for Gordon's wav repair tool...again.  This has saved my ass a bunch of times and tonight was no exception. 

A bump for Gordon's genius.

Or pigiron, who started this thread and wrote the original utility.

New product - Get your NEUMANN active mounting bars
Active microphone mounting bars for Schoeps and AKG, and Naiant AKG, ready to ship

Offline live2496

  • Trade Count: (6)
  • Taperssection Member
  • ***
  • Posts: 673
    • Gidluck Mastering
Re: Homegrown WAVE header repair utility
« Reply #139 on: April 07, 2013, 01:43:10 PM »
I don't know that "original" is quite correct in that you can find references to audiohack.exe and audiohck.zip (in 2003) three years before Pigiron's utility was written. I was helping out with wave files here back when I was testing and developing some pocket pc software and digging into file structures and the like. Of course Pigiron's utility is original in it's own right.

I suspect that Pigiron was not aware of my utility, but they use two very different approaches and one might work where another won't depending upon the source of the problem.

Pigiron's utility fixes up the header of a wave file according to your own specifications. It scans the data and writes correct counts into the header.

My utility creates a new output file. It scans for existing header information and duplicates it if found. It scans to the data marker and writes counts into the header which match the amount of data. If the file exceeds 2gb it opens a second file and writes correct information into the header for that.

Most recently I added a feature to specify a byte offset where to begin reading the data chunk. This can help if framing within the file is messed up somehow. Maybe due to missed samples for whatever reason.

Sorry for the kludgy command line stuff. But it is the easiest way to implement code that is cross-platform. It should be compilable on windows, OSX, and linux.

Gordon


oktava mc012 or dpa4060 > mic2496 > pdaudio
mackie cr1604 > rme multiface > lenovo laptop

Offline it-goes-to-eleven

  • Trade Count: (57)
  • Needs to get out more...
  • *****
  • Posts: 6702
Re: Homegrown WAVE header repair utility
« Reply #140 on: April 07, 2013, 02:35:35 PM »
Thanks for the clarification, Gordon.  It was just a little muddy with the two utilities in this thread but most mentions were not specific regarding which was in use.

New product - Get your NEUMANN active mounting bars
Active microphone mounting bars for Schoeps and AKG, and Naiant AKG, ready to ship

Offline furburger

  • Trade Count: (0)
  • Taperssection All-Star
  • ****
  • Posts: 1079
  • Gender: Male
  • UH-LASS-KUH
Re: Homegrown WAVE header repair utility
« Reply #141 on: December 01, 2014, 12:14:46 AM »
I saw that a few folks are getting corrupted headers in their wave files and having a struggle with the existing utilities trying to fix the problem. So I cobbled together a wave header repair utility this last weekend that may help... 'cause I hate to see good music go to waste ;D

But it's a butt ugly command line program... if you want pretty, try next door.

Since it's mostly "universal" C coding, I was able to get it to compile on both Linux and Winders... don't own a Mac, sorry.

Beat the hell out of it and it seems to be working, but I'd be surprised if there wasn't some bugs still down in the cracks... so for sure, only use it on a backup copy.

Here's a sample output where it successfully repaired a wave file that had nothing but zeroes in the entire header and a partially truncated audio data sample (about as bad as it get's)...

# ./fixwav junk.wav

Existing header data. Look for the words 'RIFF', 'WAVE', 'fmt',
or 'data' to see if this is even a somewhat valid WAVE header:

00000000:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000010:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000020:  00 00 00 00 00 00 00 00 00 00 00 00             ............

Exit the program now? [y/n] n
The total file size is 32617577 bytes
Chunk Size of 0 at offset 4 is incorrect... repairing
Chunk Format at offset 8 is incorrect... repairing
Subchunk1 ID at offset 12 is incorrect... repairing
Subchunk1 Size at offset 16 is incorrect... repairing
Subchunk1 Format at offset 20 is incorrect... repairing
Is the file recorded in 0 channels?  [y/n] n
Enter number of channels... 1=Mono, 2=Stereo, etc: 2
Is the number of samples per second = 0?  [y/n] n
Enter number of samples per second: 44100
Is the number of bits per sample = 0?  [y/n] n
Enter number of bits per sample: 16
Subchunk1 Format at offset 24 is incorrect... repairing
Subchunk1 Bytes Per Sample at offset 32 is incorrect... repairing
Subchunk2 ID at offset 36 is incorrect... repairing
Subchunk2 Size at offset 40 is incorrect... repairing
Found incorrect number of audio samples. This means that either
   the new WAVE header data is incorrect, or the audio samples
   in the existing file were clobbered. Do you wish to add silent
   audio samples to the end of the file?
   WARNING: this will modify the existing file. [y/n] y

Header repair is required!
   Overwrite the existing file? [y/n] y

File repair successful

As you see, you need to know a little about the file... the number of bits, the samples per second, and the number of mics... while that might stump a n00b, I don't think you'll have any problem.

One caveat... it assumes you're feeding it a "normal" wave file... i.e. only a single data "Subchunk"... if it ain't such an animal... or if it simply has junk data appended to it (there's some dumb ass programs that add ID3 tags like that), it's gonna hose up.

anyway, they're attached below... enjoy... and remember... you got it free  ;D


tried this, and it says that all 4 files are too "large" for notepad, and to open with another editor. any ideas?

for the record, one file is 30 min, 1 60, 1 2 hours and one 2.5 hours.
« Last Edit: December 01, 2014, 12:45:24 AM by furburger »
-------------
people who are fans of the music, they LOVE what I document and capture...people who are fans of themselves....not so much.

Offline gmm6797

  • Trade Count: (9)
  • Needs to get out more...
  • *****
  • Posts: 3271
  • Gender: Male
  • Schoeps MK4 > nBoxPlat > Sony M10/SD 722
    • Homepage
Re: Homegrown WAVE header repair utility
« Reply #142 on: December 01, 2014, 02:23:33 PM »
Try http://www.textpad.com/, and you need a machine with tons of memory to get the file to even open

Offline EarlyMorningRain

  • Trade Count: (6)
  • Needs to get out more...
  • *****
  • Posts: 2632
Re: Homegrown WAVE header repair utility
« Reply #143 on: December 01, 2014, 02:35:45 PM »
Hmm it's been a while since I've had to run this utility, but what is the connection to/with Notepad when running this? You are working in a Command Prompt window where it is (hopefully) trying to alter a wav file that you have defined ??
Mics:
AKG ck91 actives
AKG ck61 > Nbob collettes > PFA
Church CA 14 cards

Preamps:
Edirol UA-5 w/Oade PMod
Church 9100
Church 9100 (for use with the ck91 mics only)

Recorders:
Tascam DR680
Edirol R4 w/Oade Concert Mod
Edirol R09

gear for sale:

Offline furburger

  • Trade Count: (0)
  • Taperssection All-Star
  • ****
  • Posts: 1079
  • Gender: Male
  • UH-LASS-KUH
Re: Homegrown WAVE header repair utility
« Reply #144 on: December 02, 2014, 02:17:01 PM »
sorry, I'm a dipnoodle when it comes to the "tech" side of this, but I believe my comprehension skills to be "beginner/intermediate"...figured out that NotePad was the 'default' program, and got it to open up in WordPad, then learned a bit about the cmd window, etc.

I paid the $40 (and it goes by a LOT of names, or it's not just Wondershare/Recuva) and extracted all the files in every manner possible (.wav, raw, partition fix, blah blah)

and they're still, as is, just a 10m loop of the 1st 10m of the soundcheck...over all 4 files...nearly 6 hours

how do you you look at the raws (or what do you open them in?), and how do you attempt to fix headers (which is what I guess happened)

never added any info to the card, or wrote over anything, it locks up the Edirol when you put it in there, but the card reader on the cpu can look at the files, they're the right size, etc...and that was before any recovery, etc...

my apologies for the idiocy on my end, it'd be nice if I'd tried this kind of thing before.

-------------
people who are fans of the music, they LOVE what I document and capture...people who are fans of themselves....not so much.

Offline gmm6797

  • Trade Count: (9)
  • Needs to get out more...
  • *****
  • Posts: 3271
  • Gender: Male
  • Schoeps MK4 > nBoxPlat > Sony M10/SD 722
    • Homepage
Re: Homegrown WAVE header repair utility
« Reply #145 on: December 02, 2014, 02:58:04 PM »
1st thing, make an image of the card as a DVD ISO image, keep it safe and off line

2nd, try a check disk and if it has errors, try a repair... sometimes media fails and effs up our recordings.

I lost 2 concerts that way from the camcorder (allowed video) and it still pisses me off to this day

Offline furburger

  • Trade Count: (0)
  • Taperssection All-Star
  • ****
  • Posts: 1079
  • Gender: Male
  • UH-LASS-KUH
Re: Homegrown WAVE header repair utility
« Reply #146 on: December 02, 2014, 04:49:03 PM »
1st thing, make an image of the card as a DVD ISO image, keep it safe and off line

2nd, try a check disk and if it has errors, try a repair... sometimes media fails and effs up our recordings.

I lost 2 concerts that way from the camcorder (allowed video) and it still pisses me off to this day

how would one go about doing the 1st thing? (standard, or do I need software?)...or would the recovered files through Wondershare qualify as such?  I did 3 different recoveries, and they're all saved.

pretty sure the media 'failed' because I dropped the deck during playback...but again, during playback, meaning the files were finalized.  I'm just wondering what to reconstruct at the 10-11min mark of the soundcheck, as it either seems to be making the 1st part of it loop thru all the files, OR it overwrote that loop on all the files.

-------------
people who are fans of the music, they LOVE what I document and capture...people who are fans of themselves....not so much.

Offline furburger

  • Trade Count: (0)
  • Taperssection All-Star
  • ****
  • Posts: 1079
  • Gender: Male
  • UH-LASS-KUH
Re: Homegrown WAVE header repair utility
« Reply #147 on: December 03, 2014, 12:11:42 AM »
also, when I imported it as a 'raw', it broke the card into 30 128MB segments...to me...'raw' would be one big large file.

this makes my head hurt.

-------------
people who are fans of the music, they LOVE what I document and capture...people who are fans of themselves....not so much.

Offline gmm6797

  • Trade Count: (9)
  • Needs to get out more...
  • *****
  • Posts: 3271
  • Gender: Male
  • Schoeps MK4 > nBoxPlat > Sony M10/SD 722
    • Homepage
Re: Homegrown WAVE header repair utility
« Reply #148 on: December 03, 2014, 11:07:47 AM »
1st thing, make an image of the card as a DVD ISO image, keep it safe and off line
2nd, try a check disk and if it has errors, try a repair... sometimes media fails and effs up our recordings.
how would one go about doing the 1st thing? (standard, or do I need software?)

All I did was go into Nero and have it create an ISO to a file... and directed the source to my drive letter for my SD card... then took the completed ISO file and moved it to my backup PC for safe keeping

Offline EarlyMorningRain

  • Trade Count: (6)
  • Needs to get out more...
  • *****
  • Posts: 2632
Re: Homegrown WAVE header repair utility
« Reply #149 on: December 03, 2014, 11:12:40 AM »
I use (when I need to) ImgBurn to create image (ISO) files, it's free and works like a charm

http://www.imgburn.com/
Mics:
AKG ck91 actives
AKG ck61 > Nbob collettes > PFA
Church CA 14 cards

Preamps:
Edirol UA-5 w/Oade PMod
Church 9100
Church 9100 (for use with the ck91 mics only)

Recorders:
Tascam DR680
Edirol R4 w/Oade Concert Mod
Edirol R09

gear for sale:

 

RSS | Mobile
Page created in 0.193 seconds with 39 queries.
© 2002-2017 Taperssection.com
Powered by SMF
Website Design by Foxtrot Media, Inc., a Baltimore Website Company