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.
AudioGetVolume
An audio component can implement theAudioGetVolumefunction. The Sound Manager calls this function to determine the current volume of an audio port.
pascal ComponentResult AudioGetVolume (ComponentInstance ac, short whichChannel, ShortFixed *volume);
ac- A component instance that identifies your audio component.
whichChannel- The channel or channels whose volume you should return.
volume- On output, the current volume level of the specified channel.
DESCRIPTION
YourAudioGetVolumefunction is called by the Sound Manager to determine the current volume levels of one or more channels of an audio port. Thevolumeparameter can have any value between 0 and 1, where 0 indicates minimum volume and 1 indicates maximum volume. ThewhichChannelparameter indicates the channels or channels whose volumes you should return. The following constants are defined for thewhichChannelparameter:
#define audioAllChannels 0 /*all channels*/ #define audioLeftChannel 1 /*left channel*/ #define audioRightChannel 2 /*right channel*/RESULT CODES
YourAudioGetVolumefunction should returnnoErrif successful or an appropriate result code otherwise. In particular, if your audio component doesn't support software control of volume levels,AudioGetVolumeshould returnunImpErr.