Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 5 - Sound Components / Sound Components Reference
Sound Component-Defined Routines / Managing Source Data


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.

SoundComponentPlaySourceBuffer

A sound component must implement the SoundComponentPlaySourceBuffer function. The Sound Manager calls this function to start a new sound playing.

pascal ComponentResult SoundComponentPlaySourceBuffer 
                              (ComponentInstance ti, 
                                 SoundSource sourceID, 
                                 SoundParamBlockPtr pb, 
                                 long actions);
ti
A component instance that identifies your sound component.
sourceID
A source ID for a source component chain.
pb
A pointer to a sound parameter block.
actions
A set of 32 bit flags that describe the actions to be taken when preparing to play the source data. See "Action Flags" on page 5-27 for a description of the constants you can use to select bits in this parameter.
DESCRIPTION
Your SoundComponentPlaySourceBuffer function is called by the Sound Manager to start a new sound playing. The sound parameter block pointed to by the pb parameter specifies the sound to be played. That parameter block should be passed successively to all sound components in the chain specified by the sourceID parameter. This allows the components to determine their output formats and playback settings and to prepare for a subsequent call to their SoundComponentGetSourceData function. It also allows a sound output device component to prepare for starting up its associated hardware.

RESULT CODES
Your SoundComponentPlaySourceBuffer function should return noErr if successful or an appropriate result code otherwise.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996