Desktop Functions:

   Smart Device Functions:

Show Recent Changes
Subscribe (RSS)
Misc. Pages
Helpful Tools
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
waveoutsetvolume (winmm)
Set the volume of the specified device.

C# Signature:

[DllImport("winmm.dll", SetLastError=true, CallingConvention=CallingConvention.Winapi)]
public static extern uint waveOutSetVolume(int uDeviceID, uint dwVolume);

[DllImport("winmm.dll", SetLastError=true, CallingConvention=CallingConvention.Winapi)]
public static extern uint waveOutSetVolume(IntPtr uDeviceID, uint dwVolume);

VB Signature:

Declare Auto Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As IntPtr, ByVal dwVolume As UInteger) As UInteger

User-Defined Types:


Alternative Managed API:

Do you know one? Please contribute it!


VB - Use "Auto" in the Declare statement to have VB automatically marshal strings using the proper coding. ANSI is default.

Tips & Tricks:

Please add some!

Sample Code:

    // Each volume setting must be in the range between &H0 (silence) and &HFFFF (maximum volume).
    // ' Set the volume for all channels to &H7FFF (50%)
    // retval = waveOutSetVolume(0, &H7FFF7FFF)  ' for both channels, if needed
    public void SetVolume(uint volume)
        if (m_WaveOut != IntPtr.Zero)


Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

Access directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version