IAudio::LevelSet

HRESULT LevelSet(DWORD dwLevel);

Sets the playback or recording level of the audio device.

· Returns NOERROR if successful, or one of these error values:

E_FAIL
E_INVALIDARG
AUDERR_BADDEVICEID
AUDERR_INVALIDHANDLE
AUDERR_NEEDWAVEFORMAT
AUDERR_NODRIVER
AUDERR_NOTSUPPORTED
AUDERR_WAVEFORMATNOTSUPPORTED

dwLevel

[in] New playback or recording level. The level is a linear range from 0x0000 for absolute silence to 0xFFFF for the highest playback or recording level. The level for the left channel is in the low word, and the level for the right channel is in the high word of this parameter.

If a device does not support both left and right volume control, the low-order word of dwLevel specifies the volume level and the high-order word is ignored.

If the device does not provide a level, the function returns an error.

The change in playback or recording level occurs as soon as possible, although it may take several milliseconds to change because of hardware restrictions. Changing the level does not affect digital-audio data already played or recorded.