SetupAIFFHeader
sampleSize, compressionType, numBytes,
numFrames);
short fRefNum; a file reference number
short numChannels; specifies the number of channels for the sound
Fixed sampleRate; specifies the sampling rate for the sound short sampleSize; specifies the sample size for the sound
OSType compressionType; specifies the compression type for the sound long numBytes; specifies the number of bytes of audio data
long numFrames; specifies the number of sample frames for the
sound
AIFF-C file header:
• Uncompressed sounds of any type are stored in AIFF format (that is,
compressionType is 'NONE').
• Compressed sounds of any type are stored in AIFF-C format (that is,
compressionType is different from 'NONE').
fRefNum contains a file reference number for a file that is open for
writing.The AIFF header information is written starting at the
current file position, and the file position is left at the end of the
header upon completion.
numChannels specifies the number of channels for the sound .
sampleRate specifies the sampling rate for the sound (that is, samples per
second). Note that the most significant bit of this value is interpreted
as having the value 32,768 (not as a sign bit)
sampleSize specifies the sample size for the sound (that is, bits per sample)
compressionType specifies the compression type for the sound ('NONE', 'MAC3',
'MAC6', or other third-party types)
baseFrequency specifies the base frequency for the sound
numBytes specifies the number of bytes of audio data that are to be stored in
the Common Chunk of the AIFF or AIFF-C file. This data should be
stored right after the sound header in the file. (This value is not
necessarily the same as the number of samples in the sound.)
numFrames specifies the number of sample frames for the sound. A value needs
to be passed here only for third-party compression types. If you are
using 'NONE', 'MAC3', or 'MAC6' compression types, you can pass a 0
in this field, and SetupAIFFHeader will calculate the number of
sample frames and store it in the header..
noErr (0) No error
siIn validCompression (-223) Invalid compression type
Notes: A good way to use this routine is to create a file that you want to store a
much room the header will take up and hence to position the file to be ready
to write the audio data. Then record the data to the file, set the file position
numBytes set to the correct amount of sound data recorded. The file created