Gary Sumlak

Q: Apple Script Help Needed Editing WAV File Header

I need some advice on how to create an apple script to update a WAV file header.

 

My problem is that a program I am running to record and save audio files initially creates a raw file with an "8K" suffix (a WAV file with no header), and converts the file to 3gp format.  Unfortunately, occasionally, the conversion process fails and only a 8K file remains.  The 8K file is a standard WAV file without any header information.  I can manually edit the 8K file with 0xED and add in the proper WAV header, but I would really prefer to have a script that can do this without adding the inherent possibility of of a type-o on my part.

 

What I would like to do is be able to drag the 8K file to an Applescript app that reads the file size, calculate the header offsets, inserts the new header and saves to a new file with the WAV suffix.

 

I would be very grateful if someone can give me the outline of how the read the 8K, parse the header, etc. or possibly supply some code to do this.

 

Any help or suggestions would be greatly appreciated.

 

TIA

PowerMac, Mac OS X (10.5.8), G5 Dual 2.0 GHz, 2.5 GB RAM, ATI Ra

Posted on Oct 19, 2015 5:06 PM

Close

Q: Apple Script Help Needed Editing WAV File Header

  • All replies
  • Helpful answers