SndNewChannel
SndNewChannel Alocate a sound-channel record
#include <Sound.h> Sound Manager
OSErr SndNewChannel(chan, synth, init, userRoutine );
SndChannelPtr *chan; a pointer to a sound channel
short synth specifies which playback synthesizer is to be used
long init; specifies an initialization option
ProcPtr userRoutine ; a pointer to a callback procedure
returns Error Code; 0=no error
You use the SndNewChannel to allocate a sound-channel record in your
application's heap and return a pointer to that record
chan a pointer to a sound channel
synth specifies which playback synthesizer is to be used. You specify a
synthesizer by its resource ID, and this 'snth' resource is loaded into
memory and linked to the channel. To create a channel without linking
it to a synthesizer, pass 0 as the synth parameter. In general,
however, you should specify a nonzero value in the synth parameter
to ensure that CPU load tests are performed and hence that you can
actually produce sound in the new channel.
init specifies an initialization option that should be sent to the
synthesizer when you open the channel. For example, to open the
third wave-table channel, use initChan2 as the init parameter. Only
the wave-table synthesizer and sampled sound synthesizer currently
use the init options. To determine if a particular option is understood
by the synthesizer, use the availableCmd command with the
SndControl function.
userRoutine a pointer to a callback procedure. If your application produces
sounds asynchronously or needs to be alerted when a command has
completed, define a callback procedure and pass a pointer to that
procedure in the userRoutine parameter. This routine is called once
the synthesizer has received the callBackCmd command. If you pass
NULL as the userRoutine parameter, then any callBackCmd commands
are ignored.
Returns: an operating system Error Code.
noErr (0) No error
resProblem (-204) Problem loading the resource
badChannel (-205) Channel is corrupt or unusable

Notes: To release the memory previously allocated to a sound channel that is no
longer needed, call SndDisposeChannel.