Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 6 - Audio Components / Audio Components Reference
Audio Component-Defined Routines / Getting and Setting Volumes


Legacy Documentclose button

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.

AudioSetVolume

An audio component can implement the AudioSetVolume function. The Sound Manager calls this function to set the current volume of an audio port.

pascal ComponentResult AudioSetVolume (ComponentInstance ac, 
                                          short whichChannel, 
                                          ShortFixed volume);
ac
A component instance that identifies your audio component.
whichChannel
The channel or channels whose volume you should set.
volume
The desired volume level of the specified channel.
DESCRIPTION
Your AudioSetVolume function is called by the Sound Manager to set the volume levels of one or more channels of an audio port. See the description of the AudioGetVolume function for the values of the whichChannel and volume parameters.

RESULT CODES
Your AudioSetVolume function should return noErr if successful or an appropriate result code otherwise. In particular, if your audio component doesn't support software control of volume levels, AudioSetVolume should return unImpErr.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996