Flushing Sound Channels
Flushing Sound Channels Removing commands from the channel
If you wish to flush a sound channel without disturbing any sounds already in
progress, issue the flushCmd command. Here's an example:
mySndCmd.cmd = flushCmd; [TOKEN:12079]the command is flushCmd
mySndCmd. param1 = 0; [TOKEN:12079]unused
mySndCmd. param2 = 0; [TOKEN:12079]unused
//flush the channel
myErr = SndDoImmediate(& mySndChan, mySndCmd);
If you want to stop all sound production by a particular sound channel
immediately, you should issue a flushCmd command and then a quietCmd
command. If you issue only a flushCmd command, the sound currently playing
is not stopped. If you issue only a quietCmd command, the synthesizer stops
playing the current sound but continues with any other queued commands. (By
calling flushCmd before quietCmd command, you ensure that there are no other
queued commands to process.)
Note: The Sound Manager sends a quietCmd command when your
application calls the SndDisposeChannel function. The quietCmd
command is preceded by a flushCmd command if the quietNow
parameter is TRUE.