Hello all, I am learning new stuff in c#! I want to know how to increase computer sound when user hits a button.

The user will hit the key only once, the volume should increase from 1% to 100% (the increase in volume should not be sudden, it should be 1%,2%,3% and so on) and if the user presses the key again the volume should decrease!

4 Years
Discussion Span
Last Post by nmaillet

Try this. Changing the system volume relies on the Windows API, which requires COM Interop, so there will be no simple way to do it (aside from finding a third-party library that provides a simplified interface, which I haven't seen). There is no way to do it directly with the standard library in the .NET Framework that I am aware of.

EDIT: Note that this may not work properly on an application built for a 64-bit system without some modifications. That can be one of the downfalls of working with unmanaged applications.

Edited by nmaillet

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.