I am developing a windows ( desktop ) application in C#.Net 2005.
In this I want to un-mute my computer's volume.
Here firstly I want to check if the volume is mute or not if it is mute then un-mute the volume.
I have seen this post but it doesn't detect mute status ---http://social.msdn.microsoft.com/forums/en-US/Vsexpressvb/thread/744d940a-77f9-4904-b90b-dbb4fccb6dbc/So I just want to detect the mute status of computer's main volume.
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 .
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.
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.