求教,局域网聊天添加语音功能但是运行不了
大家好,我想在局域网聊天中添加语音功能,参考的是别人的代码,叫maturevoice
程序代码: private void tool_Voice_Click(object sender, EventArgs e)
{
netchat1.SetRemoteIPEnd(((this.Tag as TreeNode).Tag as ClassUserInfo).UserIP, 8000);
//先初始化语音模块,启动监听方法,再启动语音采集方法
if (tool_Voice.Text == "语音")
{
tool_Voice.Text = "关闭";
try
{
netchat1.Intptr = this.Handle;
netchat1.InitVoice();
}
catch
{
MessageBox.Show("声音模块初始化失败");
}
try
{
netchat1.Listen();
}
catch
{
MessageBox.Show("监听模块异常");
}
try
{
netchat1.StartSendVoice();
}
catch
{
if (MessageBox.Show("应用程序出现问题,需要重新启动应该程序嘛?", "系统提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
{
Application.Exit();//先关闭应用程序
System.Diagnostics.Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location);
}
}
}
else
{
netchat1.Stop();
tool_Voice.Text = "语音";
}
}
其中“语音”类似QQ,使用的是toolstripbutton[ 本帖最后由 恒欣 于 2012-12-17 17:16 编辑 ]






