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 theSndPauseFilePlay
function 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
SndStartFilePlay
function.DESCRIPTION
TheSndPauseFilePlay
function suspends the play from disk on the channel specified by thechan
parameter if that play from disk is not already paused; the function resumes play if the play from disk is already paused.The
SndPauseFilePlay
function is used in conjunction withSndStopFilePlay
to control play from disk on a sound channel. Note that this call can be made only if your application has already calledSndStartFilePlay
with a valid sound channel. You cannot use this function with a synchronous call toSndStartFilePlay
because, 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
chan
parameter is not being used for play from disk, thenSndPauseFilePlay
returns 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 theSndPauseFilePlay
function at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSndPauseFilePlay
function 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