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.
SoundComponentSetOutput
A sound output device component can call theSoundComponentSetOutputfunction of the Apple Mixer to indicate the type of data it expects to receive.
pascal ComponentResult SoundComponentSetOutput (ComponentInstance ti, SoundComponentDataPtr requested, SoundComponentDataPtr *actual);
ti- A component instance that identifies your sound component.
requested- A pointer to a sound component data record that specifies the type of the data your component expects to receive.
actual- This parameter is currently unused.
DESCRIPTION
The Apple Mixer'sSoundComponentSetOutputfunction can be called by a sound output device component to specify the kind of audio data the output device component wants to receive. The Apple Mixer uses that information to determine the type of sound component chain it needs to construct in order to deliver that kind of audio data to your sound output device component. For example, if your sound output device is able to accept 16-bit samples, the Sound Manager doesn't need to convert 16-bit audio data into 8-bit data.The following lines of code illustrate how the sound output device component for the Apple Sound Chip might call Apple Mixer's
SoundComponentSetOutputfunction:
myDataRec.flags = 0; /*ignored here*/ myDataRec.format = kOffsetBinary; /*ASC needs offset binary*/ myDataRec.sampleRate = rate22khz; /*ASC needs 22 kHz samples*/ myDataRec.sampleSize = 8; /*ASC needs 8-bit data*/ myDataRec.numChannels = 2; /*ASC can do stereo*/ myDataRec.sampleCount = 1024; /*ASC uses a 1K FIFO*/ myErr = SoundComponentSetOutput(mySource, &myDataRec, &myActual);In general, however, a sound output device component shouldn't need to call the Apple Mixer'sSoundComponentSetOutputfunction. Instead, it can indicate the type of data it expects to receive when it calls theOpenMixerSoundComponentfunction. TheSoundComponentSetOutputfunction is intended for sophisticated sound output device components that might want to reinitialize the Apple Mixer.
- IMPORTANT
- Only the Apple Mixer component needs to implement this function.
![]()
RESULT CODES
The Apple Mixer'sSoundComponentSetOutputfunction returnsnoErrif successful or an appropriate result code otherwise.