waveOutGetVolume

Syntax

WORD waveOutGetVolume(wDeviceID, lpdwVolume)

This function queries the current volume setting of a waveform output device.

Parameters

WORD wDeviceID

Identifies the waveform output device.

LPDWORD lpdwVolume

Specifies a far 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 is silence.

If a device does not support both left and right volume control, the low-order word of the specified location contains the mono volume level.

The full 16-bit setting(s) set with waveOutSetVolume is returned, regardless of whether the device supports the full 16 bits of volume-level control.

Return Value

Returns zero if the function was successful. Otherwise, it returns an error number. Possible error returns are:

MMSYSERR_INVALHANDLE

Specified device handle is invalid.

MMSYSERR_NOTSUPPORTED

Function isn't supported.

MMSYSERR_NODRIVER

The driver was not installed.

Comments

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 structure (filled by waveOutGetDevCaps).

To determine whether the device supports volume control on both the left and right channels, use the WAVECAPS_VOLUME flag to test the dwSupport field of the WAVEOUTCAPS structure (filled by waveOutGetDevCaps).

See Also

waveOutSetVolume