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.
SndDoImmediate
You can use theSndDoImmediate
function to place a sound command in front of a sound channel's command queue.
FUNCTION SndDoImmediate (chan: SndChannelPtr; cmd: SndCommand): OSErr;
chan
- A pointer to a sound channel.
cmd
- A sound command to be sent to the channel specified in the
chan
parameter.DESCRIPTION
TheSndDoImmediate
function operates much likeSndDoCommand
, except that it bypasses the existing command queue of the sound channel and sends the specified command directly to the Sound Manager for immediate processing. This routine also overrides anywaitCmd
,pauseCmd
, orsyncCmd
commands that might have already been processed. However, other commands already received by the Sound Manager will not be interrupted by theSndDoImmediate
function (although aquietCmd
command sent viaSndDoImmediate
will quiet a sound already playing).SPECIAL CONSIDERATIONS
WhetherSndDoImmediate
moves memory depends on the particular sound command you're sending it. Most of the available sound commands do not causeSndDoImmediate
to 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 thesoundCmd
sound command to preconfigure the channel at noninterrupt time.RESULT CODES
noErr 0 No error badChannel -205 Channel is corrupt or unusable SEE ALSO
For an example of a routine that uses theSndDoImmediate
function, see Listing 2-4 on page 2-26.