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.
SoundComponentGetSourceData
A utility component must implement theSoundComponentGetSourceData
function. A sound output device component calls this function on its source component when it needs more data.
pascal ComponentResult SoundComponentGetSourceData (ComponentInstance ti, SoundComponentDataPtr *sourceData);
ti
- A component instance that identifies your sound component.
sourceData
- On output, a pointer to a sound component data record that specifies the type and location of the data your component has processed.
DESCRIPTION
YourSoundComponentGetSourceData
function is called when the sound component immediately following your sound component in the sound component chain needs more data. Your function should generate a new block of audio data, fill out a sound component data record describing the format and location of that data, and then return the address of that record in thesourceData
parameter.Your
SoundComponentGetSourceData
function might itself need to get more data from its source component. To do this, call through to the source component'sSoundComponentGetSourceData
function. If your component cannot generate any more data, it should set thesampleCount
field of the sound component data record to 0 and returnnoErr
.
- IMPORTANT
- Sound output device components do not need to implement this function, but all utility components must implement it.
RESULT CODES
YourSoundComponentGetSourceData
function should returnnoErr
if successful or an appropriate result code otherwise.