WinMMWaveOutSetVolume Method

Sets the volume level of the specified waveform-audio output device.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("WinMM.dll", EntryPoint = "waveOutSetVolume", SetLastError = true)]
public static WinMmResult WaveOutSetVolume(
	IntPtr hwo,
	uint volume
)

Parameters

hwo  IntPtr
A IntPtr to an open waveform-audio output device.

This parameter can also be a device identifier.

volume  UInt32
T New volume setting.

The low-order word 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 volume specifies the volume level, and the high-order word is ignored.

Return Value

WinMmResult
Returns NoError if successful.

Possible error values include the following:

BadDeviceId, InvalidHandleNoDriver, NoMem, NotSupported.

Remarks

See Also