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

前端 未结 4 709
醉话见心
醉话见心 2021-01-21 23:36

Windows 7 has some new audio settings which I haven\'t been able to control from my C# application. Specifically, within the Input (microphone) properties, there is a Levels Ta

相关标签:
4条回答
  • 2021-01-21 23:50

    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.

    0 讨论(0)
  • 2021-01-21 23:51

    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.

    0 讨论(0)
  • 2021-01-22 00:06

    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

    0 讨论(0)
  • 2021-01-22 00:11

    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?

    0 讨论(0)
提交回复
热议问题