Title Banner

Previous Book Contents Book Index Next

Newton Developer Technical Information: Newton Programmer's Guide: 2.1 OS Addendum /
Chapter 7 - Sound / Sound Reference
Protos / protoSoundChannel


GetVolume

soundChannel:GetVolume()

Returns the playback volume level for the channel.

return value
The channel's playback volume, expressed in decibels. The integer value 0 corresponds to silent, and values 1, 2, 3, and 4 correspond to decibel levels -18 dB, -6 dB, -3 dB, and 0 dB (unity gain) respectively. This method returns nil when the channel does not specify its own volume but instead inherits it from user preference settings (the soundVolumeDb variable), which is the default behavior.

DISCUSSION

The channel must be open. If it is not, an exception with the error code -30010 is thrown.

If the unit has a hardware volume control, and the sound channel is playing, this method returns the actual playing volume; otherwise, it returns the channel volume as set by the *SetVolume method. If no volume has been set using *SetVolume, and the channel is not playing, this method returns nil.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
26 APR 1997



Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help