AAM_VolumeControl

This function controls volume, balance, and fade.

Syntax

DWORD AAM_VolumeControl( DWORD dwFlag, LONG *plValue );

Parameters

dwFlag
Specifies a bitmask of flags. It is one of the following values:
AAM_FLAG_VOLUME
Gets or sets the master volume attenuation (0 specifies maximum gain).
AAM_FLAG_VOLUME_MASTER
Sets the master volume.
AAM_FLAG_RANGE
Gets the range of values in plValue. This option cannot be set, only retrieved.
AAM_FLAG_DBBASED
Specifies the use of decibel units rather than OEM-defined increments.
AAM_FLAG_MUTE
Gets or sets the mute status. This option is used by the system mute button.TRUE means that mute is on. The mute button mutes only background audio.
AAM_FLAG_VOLUME_SOURCE0
Indicates volume source 0, which is background music.
AAM_FLAG_VOLUME_SOURCE1
Indicates volume source 1, which is foreground text-to-speech (TTS) and event sounds.
AAM_FLAG_BALANCE
Gets or sets the attenuation of the left speakers (positive) and right (negative) speakers.
AAM_FLAG_FADE
Gets or sets the attenuation of the rear speakers (positive) and front (negative) speakers.
AAM_FLAG_CENTER
Gets or sets the attenuation level of the center speaker.
AAM_FLAG_WOOFER
Gets or sets the attenuation level of the subwoofer.

To set a property, use a bitwise OR to combine the chosen flag with AAM_FLAG_SET, and set plValue to the desired value. To get a property, use a bitwise OR the flag with AAM_FLAG_GET and plValue is set to the current value.

plValue
Pointer to a long integer.

Return Values

Zero indicates success. AAM_ERR_INVALIDPARAM indicates an invalid parameter. AAM_ERR_DEVICEFAIL indicates failure. AAM_ERR_NOTSUPPORTED indicates that the device does not support this feature.

Remarks

To get the range of values available, set the AAM_FLAG_RANGE flag. The function returns the maximum and minimum volume attenuation. The high-order word has the maximum attenuation level and the low-order word the maximum gain level. In the case of parameters like balance and fade, the minimum value may be negative. For example, if the high-order word for balance is 0 and the low-order word is 20, it means that the left speaker can be adjusted from 0 to 20, and the right speaker from 0 to -20. Fade works in a similar fashion.

See Also

HIWORD, LOWORD