Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 2 - Sound Manager / Sound Manager Reference
Sound Manager Routines / Playing From Disk


Legacy Documentclose button

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 the SndPauseFilePlay 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
The SndPauseFilePlay function suspends the play from disk on the channel specified by the chan 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 with SndStopFilePlay to control play from disk on a sound channel. Note that this call can be made only if your application has already called SndStartFilePlay with a valid sound channel. You cannot use this function with a synchronous call to SndStartFilePlay 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, then SndPauseFilePlay returns the result code channelNotBusy. 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 the SndPauseFilePlay function at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the SndPauseFilePlay function are
Trap macroSelector
_SoundDispatch$02040008

RESULT CODES
noErr0No error
queueFull-203No room in the queue
badChannel-205Channel is corrupt or unusable
channelNotBusy-211Channel not currently used

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996