在VS2008+WIN2008使用SpeechLib5.3没声音
开发的是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);
}
}
}
编译是成功,并运行,但是没声音。。很奇怪。望解决。谢谢。