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.
SndDoCommand
You can queue a command in a sound channel by calling theSndDoCommandfunction.
FUNCTION SndDoCommand (chan: SndChannelPtr; cmd: SndCommand; noWait: Boolean): OSErr;
chan- A pointer to a valid sound channel.
cmd- A sound command to be sent to the channel specified in the
chanparameter.noWait- A flag indicating whether the Sound Manager should wait for a free space in a full queue (
FALSE) or whether it should return immediately with aqueueFullresult code if the queue is full (TRUE).DESCRIPTION
TheSndDoCommandfunction sends the sound command specified in thecmdparameter to the end of the command queue of the channel specified in thechanparameter.The
noWaitparameter has meaning only if a sound channel's queue of sound commands is full. If thenoWaitparameter is set toFALSEand the queue is full, the Sound Manager waits until there is space to add the command, thus preventing your application from doing other processing. IfnoWaitis set toTRUEand the queue is full, the Sound Manager does not send the command and returns thequeueFullresult code.SPECIAL CONSIDERATIONS
WhetherSndDoCommandmoves memory depends on the particular sound command you're sending it. Most of the available sound commands do not causeSndDoCommandto move memory and can therefore be issued at interrupt time. Moreover, you can sometimes safely send commands at interrupt time that would otherwise cause memory to move if you've previously issued thesoundCmdsound command to preconfigure the channel at noninterrupt time.RESULT CODES
noErr 0 No error queueFull -203 No room in the queue badChannel -205 Channel is corrupt or unusable SEE ALSO
For an example of a routine that uses theSndDoCommandfunction, see Listing 2-15 on page 2-42.