Exp1to3
Exp1to3 Expand a sound previously compressed at a ratio of 3:1
#include <Sound.h> Sound Manager
void Exp1to3( inBuffer, outBuffer, cnt, inState, outState,
numChannels, whichChannel);
void * inBuffer; is a pointer to a buffer of samples
void * outBuffer; is a pointer to a buffer where the samples are to be
written
unsigned long cnt; is the number of samples to expand
void * inState; is a pointer to a buffer from which the input state
of the algorithm is read
void * outState; is a pointer to a buffer to which the output state of
the algorithm is written
unsigned long numChannels; is the number of channels in the buffer
unsigned long whichChannel; is used to specify which channel to expand
The Exp1to3 function is used to expand a sound that was previously
compressed at a ratio of 3:1
inBuffer is a pointer to a buffer of samples to be expanded. The samples must
be in 8-bit offset binary format.
outBuffer to a buffer where the expanded samples will be written. This buffer
must be at least cnt * 6 bytes in size for both 3:1 and 6:1 expansion.
cnt The packet size for 3:1 is 2 bytes; therefore one packet of 3:1
expands into 6 bytes.
inState is a pointer to a buffer from which the input state of the algorithm
is read. To initialize the algorithm, this buffer should be filled with
zeros. The size of the buffer should be 128 bytes .
outState is a pointer to a buffer to which the output state of the algorithm is
written. The size of the buffer should be 128 bytes. The inState and
outState parameters may point to the same buffer.
numChannels is the number of channels in the buffer pointed to by the inBuffer
parameter. It is assumed that if numChannels is greater than 1, then
the compressed sound is stored in interleaved format on a packet
basis.
whichChannel is used to specify which channel to expand when numChannels is
greater than 1. When numChannels is set to 1, whichChannel is
unused. Acceptable values of the whichChannel parameter range from
1 to numChannels
Returns: none

Notes: The output stream that is produced by the Exp1to3 compression routine
is always monophonic, regardless of the value you pass in the numChannels
parameter.