当前位置: 代码迷 >> .NET组件控件 >> Speech.Synthesis疏失
  详细解决方案

Speech.Synthesis疏失

热度:310   发布时间:2016-05-04 23:28:39.0
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();
        }
    }
}

------解决方案--------------------
可能是因为64位关系的原因吧,我也试过了,在控制面板内根本就找不到有关语音这一项。还有安装完tts5.1后文件夹的方式与网络上的完全不同。试试改回x86试试看。
  相关解决方案