Important: Inside Macintosh: Sound is deprecated as of Mac OS X v10.5. For new audio development in Mac OS X, use Core Audio. See the Audio page in the ADC Reference Library.
Exp1to3
You can use theExp1to3procedure to expand a buffer of sound samples you previously have compressed with theComp3to1procedure.
PROCEDURE Exp1to3 (inBuffer: Ptr; outBuffer: Ptr; cnt: LongInt; inState: Ptr; outState: Ptr; numChannels: LongInt; whichChannel: LongInt);
inBuffer- A pointer to a buffer of packets to be expanded.
outBuffer- A pointer to a buffer where the expanded samples will be written.
cnt- The number of packets to expand.
inState- A pointer to a 128-byte buffer from which the input state of the algorithm is read, or
NIL. To initialize the algorithm, this buffer should be filled with zeros.outState- A pointer to a 128-byte buffer to which the output state of the algorithm is written, or
NIL. This buffer might be the same as that specified by theinStateparameter.numChannels- The number of channels in the buffer pointed to by the
inBufferparameter.whichChannel- The channel to expand, when
numChannelsis greater than 1. This parameter must be in the range of 1 tonumChannels.DESCRIPTION
TheExp1to3procedure expandscntpackets of sound stored in the buffer specified byinBufferand places the result in the buffer specified byoutBuffer, whose size must be at leastcntpackets * 2 bytes per packet * 3, orcnt * 6bytes. IfnumChannelsis greater than 1, then the compressed sound must be stored in interleaved format on a packet basis.If you expand compressed sound data that includes multiple sound channels, you retain only one channel of sound, which you specify in the
whichChannelparameter. Thus, if you use theExp1to3procedure to expand three-channel sound, the output buffer will be the same size as the input buffer since only one channel is retained. To retain multiple channels of sound after expansion, you must call theExp1to3procedure for each channel to be expanded and then interleave the expanded sound data on a sample basis.The
Exp1to3procedure expands every packet of sampled-sound data to exactly 6 bytes.You can use the
inStateandoutStateparameters to allow the MACE compression routines to preserve information about algorithms across calls. Alternatively, you may passNILstate buffers and let the Sound Manager allocate the buffers internally.SPECIAL CONSIDERATIONS
Because theExp1to3procedure might allocate memory, you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theExp1to3procedure are
Trap macro Selector _SoundDispatch $00080010