How can I programmatically control the Microphone and Microphone Boost settings in Win7 from C#?

这一生的挚爱 提交于 2019-12-02 11:43:43

I was unable to find an API that provided control over these specific volume levels. Please add new answers if they are available and I'll gladly accept a working solution.

You can use a very useful library built around windows mixer by Caster Tiu from http://www.codeproject.com/KB/audio-video/AudioLib.aspx?msg=1323850

According to documentation on this page:

Specific controls like Fadder, Microphone Boost, bass, treble, etc. can be accessed via the MixerControl object using ValueAsSigned, ValueAsUnsigned and ValueAsBoolean properties, but they are not implemented as standard properties because they don't belong to all controls.

There is a WalkTreeBackwardsFromPart sample that shows how to enumerate audio endpoints and print out their current volume, You can modify the code to unmute the analog mixer via IDeviceTopology

Windows should unmute the software volume at the beginning of a capture session, does your device have a hardware volume?

The IAudioEndpointVolume interface might work for you. It has functions to get/set mute state and volume levels for a recording or playback device.

Reference: http://msdn.microsoft.com/en-us/library/windows/desktop/dd370892(v=vs.85).aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!