在 Windows 7 上静音麦克风 [英] Mute microphone on Windows 7
问题描述
我在将 Windows 7 机器上的麦克风静音时遇到问题.但是我发现的所有代码都无法运行,或者它没有执行任何已运行的代码.是否已为使用 C# 代码的 Windows 7 机器完成.我只需要一个开/关解决方案.DDL 文件也适用于 Win x64bit.但我认为我在另一个地方创建了一个错误.
I have an problem with muting the mic on an windows 7 machine. But all the code i have found dosen't run ore it's not doing anything the runned. Have is it done for an Windows 7 machine using C# code. I just need an on/off solution. The DDL file works also with Win x64bit. But i thing that i creates an error another place.
mixers.Recording.Lines.GetMixerFirstLineByComponentType(
MIXERLINE_COMPONENTTYPE.SRC_MICROPHONE).Volume = 0;
if (!mediaElement1.CheckAccess()) mediaElement1.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)delegate { mediaElement1.Play(); });
if (MessageBox.Show("Incoming Call from: " + string.Format(e.RemoteParticipant), "Video Chat Call", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
mixers.Recording.Lines.GetMixerFirstLineByComponentType(
MIXERLINE_COMPONENTTYPE.SRC_MICROPHONE).Volume = 1;
if (!mediaElement1.CheckAccess()) mediaElement1.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)delegate { mediaElement1.Stop(); });
_currentConversation.StartVideo();
}'
如果在 if (MessageBox.Show("Incoming Call from:" + string.Format(e.RemoteParticipant), "Video Chat Call", MessageBoxButton.YesNo) == MessageBoxResult.Yes)代码>并说{算术运算导致溢出."}
If error occurs at if (MessageBox.Show("Incoming Call from: " + string.Format(e.RemoteParticipant), "Video Chat Call", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
and says {"Arithmetic operation resulted in an overflow."}
推荐答案
http://www.computercabal.com/2010/11/mute-microphone-from-c-on-windows.html——这位先生似乎也有类似的问题,并且他提供了解决方案的源代码.
http://www.computercabal.com/2010/11/mute-microphone-from-c-on-windows.html -- this gentleman appears to have had a similar problem, and he's provided the source code for a solution.
这篇关于在 Windows 7 上静音麦克风的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!