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 theAudioGetVolume
function. 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
YourAudioGetVolume
function is called by the Sound Manager to determine the current volume levels of one or more channels of an audio port. Thevolume
parameter can have any value between 0 and 1, where 0 indicates minimum volume and 1 indicates maximum volume. ThewhichChannel
parameter indicates the channels or channels whose volumes you should return. The following constants are defined for thewhichChannel
parameter:
#define audioAllChannels 0 /*all channels*/ #define audioLeftChannel 1 /*left channel*/ #define audioRightChannel 2 /*right channel*/RESULT CODES
YourAudioGetVolume
function should returnnoErr
if successful or an appropriate result code otherwise. In particular, if your audio component doesn't support software control of volume levels,AudioGetVolume
should returnunImpErr
.