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.
SndPauseFilePlay
You can use theSndPauseFilePlayfunction to toggle the state of a play from disk in progress, just as you might use the pause button on an audiocassette tape player to temporarily pause and then resume play.
FUNCTION SndPauseFilePlay (chan: SndChannelPtr): OSErr;
chan- A pointer to a valid sound channel currently processing a play from disk initiated by a call to the
SndStartFilePlayfunction.DESCRIPTION
TheSndPauseFilePlayfunction suspends the play from disk on the channel specified by thechanparameter if that play from disk is not already paused; the function resumes play if the play from disk is already paused.The
SndPauseFilePlayfunction is used in conjunction withSndStopFilePlayto control play from disk on a sound channel. Note that this call can be made only if your application has already calledSndStartFilePlaywith a valid sound channel. You cannot use this function with a synchronous call toSndStartFilePlaybecause, in that case, program control does not return to the caller until after the sound has completely finished playing.If the channel specified by the
chanparameter is not being used for play from disk, thenSndPauseFilePlayreturns the result codechannelNotBusy. If the channel is busy and paused, then play from disk is resumed. If the channel is busy and the channel is not paused, then play from disk is suspended.SPECIAL CONSIDERATIONS
You can call theSndPauseFilePlayfunction at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSndPauseFilePlayfunction are
Trap macro Selector _SoundDispatch $02040008 RESULT CODES
noErr 0 No error queueFull -203 No room in the queue badChannel -205 Channel is corrupt or unusable channelNotBusy -211 Channel not currently used