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.
OpenMixerSoundComponent
A sound output device component can use theOpenMixerSoundComponent
function to open and connect itself to the Apple Mixer component.
pascal OSErr OpenMixerSoundComponent (SoundComponentDataPtr outputDescription, long outputFlags, ComponentInstance *mixerComponent);
outputDescription
- A description of the data format your sound output device is expecting to receive.
outputFlags
- A set of 32 bit flags that provide additional information about the data format your output device is expecting to receive. See "Data Format Flags" beginning on page 5-28 for a description of the constants you can use to select bits in this parameter.
mixerComponent
- The component instance of the Apple Mixer component. You need this instance to call the
SoundComponentGetSourceData
andCloseMixerSoundComponent
functions.DESCRIPTION
TheOpenMixerSoundComponent
function opens the standard Apple Mixer component and creates a connection between your sound output device component and the Apple Mixer. If your output device can perform specific operations on the stream of audio data, such as channel mixing and rate conversion, it should callOpenMixerSoundComponent
as many times as are necessary to create a unique component chain for each sound source. If, on the other hand, your output device does not perform channel mixing, it should callOpenMixerSoundComponent
only once, from itsSoundComponentInitOutputDevice
function. This opens a single instance of the Apple Mixer component, which in turn manages all the available sound sources.Your component specifies the format of the data it can handle by filling in a sound component data record and passing its address in the
outputDescription
parameter. The sound component data record specifies the data format as well as the sample rate and sample size expected by the output device component. If these specifications are sufficient to determine the kind of data your component can handle, you should pass the value 0 in theoutputFlags
parameter. Otherwise, you can set flags in theoutputFlags
parameter to select certain kinds of input data. For example, you can set thekNoChannelConversion
flag to prevent the component chain from converting monophonic sound to stereo sound, or stereo sound to monophonic sound. See "Data Format Flags" beginning on page 5-28 for a description of the constants you can use to select bits in theoutputFlags
parameter.SPECIAL CONSIDERATIONS
TheOpenMixerSoundComponent
function is available only in versions 3.0 and later of the Sound Manager. It should be called only by sound output device components.