【发布时间】:2012-03-22 12:08:35
【问题描述】:
我在将 Windows 7 机器上的麦克风静音时遇到问题。但是我发现的所有代码都没有运行,或者运行时它没有做任何事情。是否已为使用 C# 代码的 Windows 7 机器完成。我只需要一个开/关解决方案。 DDL 文件也适用于 Win x64bit。但我认为我在另一个地方造成了错误。
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) 发生错误并显示{“算术运算导致溢出。”}
【问题讨论】:
-
什么是
e.RemoteParticipant?如果您将该 string.Format 放在它自己的行上并将其保存到变量中,该错误是否会发生在该行上?实际上我没有看到只接受一个参数的string.Format的重载,那是扩展方法吗?