在VS2008+WIN2008使用SpeechLib5.3没声音

johncccheung 2010-12-06 09:47:33
开发的是CS的程序,在项目应用了COM组件,using 了。

并且代码:

using SpeechLib;//导入语音


namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
//语音朗读
private SpVoice speech = new SpVoice();

public Form1()
{
InitializeComponent();

try
{
speech.Rate = 5;
speech.Volume = 100;
speech.Voice = speech.GetVoices(string.Empty, string.Empty).Item(1);
}
catch { }

SpeechSpeak("测试");

}

)

private void Form1_Load(object sender, EventArgs e)
{
SpeechSpeak("测试");

}


private void SpeechSpeak(string SpeakString)
{
speech.Speak(SpeakString, SpeechVoiceSpeakFlags.SVSFlagsAsync);
}
}
}

编译是成功,并运行,但是没声音。。很奇怪。望解决。谢谢。
...全文
126 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
johncccheung 2010-12-07
  • 打赏
  • 举报
回复
自行解决了···
speech.GetVoices(string.Empty, string.Empty).Item(1); --这个只能支持英文
speech.GetVoices(string.Empty, string.Empty).Item(0); ----这个才是WIN2008 控制面板下面 语音 的默认值
--能支持中文
ZengHD 2010-12-06
  • 打赏
  • 举报
回复
把“测试”换成“Hello World”
crackdung 2010-12-06
  • 打赏
  • 举报
回复
幹嘛用它

用這個吧

http://www.multimediasoft.com/



my blog
http://ufo-crackerx.blog.163.com/

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧