Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 2 - Sound Manager / Sound Manager Reference
Sound Manager Routines / Compressing and Expanding Audio Data


Legacy Documentclose button

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.

Exp1to6

You can use the Exp1to6 procedure to expand a buffer of sound samples you previously have compressed with the Comp6to1 procedure.

PROCEDURE Exp1to6 (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 the inState parameter.
numChannels
The number of channels in the buffer pointed to by the inBuffer parameter.
whichChannel
The channel to expand, when numChannels is greater than 1. This parameter must be in the range of 1 to numChannels.
DESCRIPTION
The Exp1to6 procedure expands cnt packets of sound stored in the buffer specified by inBuffer and places the result in the buffer specified by outBuffer, whose size must be at least cnt packets * 1 byte per packet * 6, or cnt * 6 bytes. If numChannels is greater than 1, then the compressed sound must be stored in interleaved format on a packet basis. The Exp1to6 procedure works just like the Exp1to3 procedure, but expands 1-byte packets rather than 2-byte packets.

SPECIAL CONSIDERATIONS
Because the Exp1to6 procedure might allocate memory, you should not call it at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the Exp1to6 procedure are
Trap macroSelector
_SoundDispatch$00100010


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996