Using Global Sound Preferences
User preferences for sound are maintained in the user configuration data, which is stored in the system soup. A sound channel can override specific preferences, however.This section describes how to use the
GetUserConfig
andSetUserConfig
global functions to access sound-related user configuration variables.Getting and Setting Input Gain Preference
To retrieve the user preference input gain value, pass the'inputGain
symbol to theGetUserConfig
function, as in the following example:
The value returned is an integer between 0 and 255 that sound channels used for input take as the default value of theirGetUserConfig('inputGain);
inputGain
slot. The default value is 128.To set the global input gain value, pass the
'inputGain
symbol and the new gain value to theSetUserConfig
function, as in the following example:
This code sets the value used as the default value of theSetUserConfig('inputGain, gain);
inputGain
slot in sound channels used for input. The gain parameter must hold an integer value between 0 and 255.This call changes the value of the
inputGain
slot in the system's user configuration data and the input gain in any active channels, but not the value of theinputGain
slots in any active channels. That is, the input gain for an active channel is changed, but the value of theinputGain
slot in the sound channel frame is not updated to reflect this change.Getting and Setting Default Input or Output Devices
To retrieve the user preference for the default sound input device, pass the'inputDevice
symbol to theGetUserConfig
function, as in the following example:
This code returns an integer representing the current default input device. This default can be overridden by putting anGetUserConfig('inputDevice);
inputDevice
slot in your sound channel. Device definitions are given in "Devices and Channels".To set the default input device, pass the
'inputDevice
symbol and the new value to theSetUserConfig
function, as in the following example:
This code sets a value that indicates the default input device used during recording. It does not change the device for a currently recording input channel.SetUserConfig('inputDevice, value);
To retrieve the user preference for the default sound output device, pass the
'outputDevice
symbol to theGetUserConfig
function, as in the following example:
This code returns an integer representing the current default output device. This default can be overridden by putting anGetUserConfig('outputDevice);
outputDevice
slot in your sound channel.To set the default output device, pass the
'outputDevice
symbol and the new value to theSetUserConfig
function, as in the following example:
This code sets a value that indicates the default output device used during playback. It does not change the device for a currently playing output channel.SetUserConfig('outputDevice, value);
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help