This routine can write AFsp (Sun) audio files, RIFF WAVE files and headerless audio files.
For the fixed point file data representations, input values in the following ranges will be converted without clipping.
data format allowed values 8-bit mu-law - [ -32636, +32636 ] 8-bit A-law - [ -32768, +32768 ] 8-bit integer - [ -16384, -16383 ] 16-bit integer - [ -32768, +32767 ]For AFsp files containing floating-point data, values are scaled by 1/32768 before being written to the file. For data values between [ -32768, +32768 ], the file data will lie in the range [ -1, +1]. For headerless files of any data format, the values are written scaled by unity.
Fformat = Dformat + FtypeFor Ftype equal to zero, the file will have the standard AFsp audio file header. The Ftype flag allows for other file types as described below. Note that not all data formats are allowed for all file types. Dformat: data format
FD_MULAW8 = 1, mu-law 8-bit data FD_ALAW8 = 2, A-law 8-bit data FD_UINT8 = 3, offset-binary 8-bit integer data FD_INT8 = 4, two's-complement 8-bit integer data FD_INT16 = 5, two's-complement 16-bit integer data FD_FLOAT32 = 6, 32-bit floating-point data FD_TEXT = 7, text dataFtype: file type
FW_AFsp = FW_SUN = 0, AFsp (Sun) audio file FW_WAVE = 256, RIFF WAVE file FW_AIFF_C = 512, AIFF-C audio file FW_NH_EB = 768, Headerless file (big-endian byte order) FW_NH_EL = 1024, Headerless file (little-endian byte order) FW_NH = FW_NH_NATIVE = 1280, Headerless file (native byte order) FW_NH_SWAP = 1536, Headerless file (swapped byte order)