How to detect mute or un-mute of computer's main volume?

All replies

  • Hi,


    If your system is XP, you can control the volume by waveoutGetVolumn and waveOutSetVolume API.

    For more details, please check the example in the following Link:

    Task 1: Mute and Unmute Sound


    If your system is Vista or Win 7, the following API works.

    • MMDevice API - This API allows enumeration and instancing of the available audio devices in the system.
    • WASAPI - This API allows playback and recording of audio streams.
    • DeviceTopology API - This API allows access to hardware features such as bass, treble, and auto gain control.
    • EndpointVolume API - This API allows access to the Volume and Peak meters.

    The following is an example about Control Volume in vista. It also works on win 7 .

    Vista Core Audio API Master Volume Control 

    Best regards,

    Ling Wang

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Vista Core Audio API Master Volume Control

    • Marked as answer by Jing0Moderator Monday, January 04, 2010 2:26 AM
    • Unmarked as answer by Harsh1 Tuesday, January 05, 2010 6:12 AM
    Wednesday, December 30, 2009 7:54 AM
  • For windows XP machine -

    If computer's main volume control is mute then above code could not check it.

    Also in the link provided if we have to mute the volume then we have to set volume to zero and in case of unmute just restore previous value of volume but if Computer's main volume is Muted then there is no effect of that code.

    So I want a method to un-mute computer's main volume control.

    Tuesday, January 05, 2010 6:12 AM
  • I face the same problem.A MVP replied that use Spy to detect the change of system volume panel form when u mute or unmute.
    but I don't know how to do this.

    Tec is power!
    Tuesday, January 19, 2010 1:37 AM
  • Hi,

           Actually I am still looking to solve this problem.

    But now I think in .Net we cannot do it. So I left searching for this.
    Tuesday, January 19, 2010 10:51 AM