waveInGetVolume(3mms) — Subroutines
Name
waveInGetVolume --- Query the current audio input volume setting
Syntax
#include <mme/mme_api.h>
MMRESULT waveInGetVolume(UINT uClassDeviceID,
LPDWORD lpdwVolume);
Arguments
UINT uClassDeviceID
Identifies the waveform audio input 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. 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 waveInSetVolume function are returned whether or not the device supports the full 16 bits of volume-level control.
The lpdwVolume argument must be allocated with the mmeAllocMem function before being passed to the waveInGetVolume function.
See the mmeAllocMem(3mms) reference page for more information about allocating memory for the lpdwVolume argument.
Description
The waveInGetVolume function queries the current volume setting of the specified waveform audio input device. Not all audio 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
The waveInGetVolume function is a Digital extension to the Microsoft multimedia API specification.
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}