Speech.Synthesis出错
环境win7 64位 vs2013
学习Speech.Synthesis文本朗读,编译没错,运行出错,请大家帮助解决,谢过了。
代码如下:
using System;
using System.Speech.Synthesis;
namespace SampleSynthesis
{
class Program
{
static void Main(string[] args)
{
// Initialize a new instance of the SpeechSynthesizer.
using (SpeechSynthesizer synth = new SpeechSynthesizer())
{
// Configure the audio output.
synth.SetOutputToDefaultAudioDevice();
// Speak a string synchronously.
synth.Speak("What is your favorite color?");
}
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}