waveOutGetVolume(3mms) — Subroutines
Name
waveOutGetVolume --- Query the current audio output volume setting
Syntax
#include <mme/mme_api.h>
MMRESULT waveOutGetVolume(UINT uClassDeviceId,
LPDWORD lpdwVolume);
Arguments
UINT uClassDeviceId
Identifies the waveform audio output device.
LPDWORD lpdwVolume
Specifies a pointer to a location to be filled with the current volume setting. The low-order word of this location contains the left-channel volume setting, and the high-order word contains the right-channel setting. A value of 0xFFFF represents full volume and a value of 0x0000 represents full muting (silence).
If a device does not support both left and right volume control, the low-order word of the specified location contains the monovolume level. The full 16-bit settings that are set with the waveOutSetVolume function are returned, whether or not the device supports the full 16 bits of volume-level control.
The lpdwVolume argument must be allocation with the mmeAllocMem function before being passed to the waveOutGetVolume function.
See the mmeAllocMem(3mms) reference page for more information about the allocating memory for the lpdwVolume argument.
Description
The waveOutGetVolume function queries the current volume setting of the specified waveform audio output device. Not all devices support volume changes. To determine whether the device supports volume control, use the WAVECAPS_VOLUME flag to test the dwSupport field of the WAVEOUTCAPS data structure filled by the waveOutGetDevCaps function.
To determine whether the device supports volume control on both the left and right channels, use the WAVECAPS_LRVOLUME flag to test the dwSupport field of the WAVEOUTCAPS data structure filled by the waveOutGetDevCaps function.
Extensions
None.
Return Values
Returns MMSYSERR_NOERROR if the function is successful; otherwise, it returns one of the following error codes:
MMSYSERR_BADDEVICEID@T{ The specified device ID is out of range. T} MMSYSERR_NODRIVER@T{ The driver is not installed. T} MMSYSERR_NOTSUPPORTED@T{ The function is not supported. T}