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.
SndDisposeChannel
If you allocate a sound channel by calling theSndNewChannel
function, you must release the memory it occupies by calling theSndDisposeChannel
function.
FUNCTION SndDisposeChannel (chan: SndChannelPtr; quietNow: Boolean): OSErr;
chan
- A pointer to a valid sound channel record.
quietNow
- A Boolean value that indicates whether the channel should be disposed immediately (
TRUE
) or after sound stops playing (FALSE
).DESCRIPTION
TheSndDisposeChannel
function disposes of the queue of sound commands associated with the sound channel specified in thechan
parameter. If your application created its own sound channel record in memory or installed a sound as a voice in a channel, the Sound Manager does not dispose of that memory. The Sound Manager also does not release memory associated with a sound resource that you have played on a channel. You might use theuserInfo
field of the sound channel record to store the address of a sound handle you wish to release before disposing of the sound channel itself.The
SndDisposeChannel
function can dispose of a channel immediately or wait until the queued commands are processed. IfquietNow
is set toTRUE
, aflushCmd
command and then aquietCmd
command are sent to the channel bypassing the command queue. This removes all commands, stops any sound in progress, and closes the channel. IfquietNow
is set toFALSE
, then the Sound Manager issues aquietCmd
command only; it does not bypass the command queue, and it waits until thequietCmd
command is processed before disposing of the channel.SPECIAL CONSIDERATIONS
Because theSndDisposeChannel
function might dispose of memory, you should not call it at interrupt time.RESULT CODES
noErr 0 No error badChannel -205 Channel is corrupt or unusable