towav - convert binary file to ASEL .wav format
towav [-options:values] file.ext
towav reads a binary file and converts it to ASEL .wav format by
appending the correct header structure. Existing headers
can be removed in the process if necessary, and data can
be slightly reformatted (byte swapping for machines using
motorola or equivalent chips that store integers in hi-lo
byte order) and scaled by a constant integer divisor.
- Number of bytes to skip at the start of the
old file. Allows one to skip other headers.
[default = -SK:0]
- Length of each sample from the input file
in bytes. [-WO:2]
- Sampling rate in Hz. [-SA:20200]
- Swap lo and hi bytes of each sample. [-NOSWAP]
- Integer scale divisor. [-SC:1]
- Binary data format as:
- OB - 12-bit Offset Binary.
- TC - 12-bit twos-complement.
- PC - 16-bit twos-complement.
Be sure that the input file does not have the extension .WAV!
This program builds the output file name by stripping the
input file of its extension and appending .WAV. On a PC,
this can result in attempts to overwrite the file with itself
and will surely result in I/O errors and lost clusters!
The use of the old ASEL wav format is being phased out. This program
should be rewritten to produce output in RIFF format.
H.T.Bunnell, Shirely Peters.