Batch Fix WAV Header

Dear All,

[Audacity v.2.2.2; Windows 10 Pro, 64-bit, v1803]

I record sets of wav files with autonomous sound recorders (underwater wildlife recordings). Sometimes the wav file header appears to be incomplete or broken, such that the files appear empty when opened in Audacity or my other sound editing software Raven Pro. Windows explorer does give correct file sizes for these files though. It appears to happen when a recording is interupted by the recorder system’s power cycling.

I can fix the files by importing them into Audacity as raw data (parameters: signed 16-bit PCM, little-endian, 2-channel, 0 offset, 100% to import, sampling rate 125,000 Hz). Then exporting them as 16-bit wav. Good.

I have many of these files though (sometimes 1000s) however, and would like to automate this as a batch process. Each file requires me to select the file, change the default import parameters, change the project rate to 125,000 Hz, and click ‘ok’ for the export file details.

I have done this successfully with ‘apply chain’ previously - the chain was just:
01 Export as WAV (no parameters)
02 - END -

I don’t know why it doesn’t work for my current files - possibly the slightly weird project sampling rate?

Anyhow - can anyone tell me whether I can automate my import as raw data / export as wav process?



Audacity does not support import RAW as a batch process.
Normal import may work sometimes, depending on how badly damaged the header is, but it will be very hit or miss.

I think SoX is likely to provide a better solution. It is a command line program (no GUI) so you would need to write a script to run the program as a batch process.
The website for SoX is here:
The documentation for SoX is here:

Hi Steve,

Thanks a lot for your reply. I’ll give SoX a go,