我已经安装了微软语音平台SDK和运行时,以及两个语言包的英语和俄语。我的代码
SpeechSynthesizer synthesizer = new SpeechSynthesizer();
synthesizer.Volume = 100; // 0...100
synthesizer.TtsVolume = 100;
synthesizer.Rate = 0; // -10...10
foreach (InstalledVoice voice in synthesizer.GetInstalledVoices()) {
VoiceInfo info = voice.VoiceInfo;
Console.WriteLine(" Voice Name: " + info.Name);
synthesizer.SelectVoice(info.Name);
synthesizer.SpeakStarted += SPeackStarted;
synthesizer.Speak("Hello");
Console.ReadKey();
}但它不会说话。我做错了什么?
发布于 2014-04-10 11:39:30
我认为你还需要配置音频输出。
你可以这样做:
SpeechSynthesizer synthesizer = new SpeechSynthesizer();
synthesizer.SetOutputToDefaultAudioDevice();欲了解更多信息:
http://msdn.microsoft.com/en-us/library/system.speech.synthesis.speechsynthesizer%28v=vs.110%29.aspx
https://stackoverflow.com/questions/22986835
复制相似问题