none
c#使用speech platform sdk 11时出现Speak error 80004005错误 RRS feed

  • 问题

  • synthesizer.SelectVoice("Microsoft Server Speech Text to Speech Voice (zh-TW, HanHan)");  
    synthesizer.SetOutputToDefaultAudioDevice();
    PromptBuilder pb2 = new PromptBuilder();   
    string str2 = rtxtInput.Text;       
    pb2.AppendSsmlMarkup(str2);          
    synthesizer.Speak(pb2);

    在执行Speak方法时会出现
    “System.InvalidOperationException”类型的未经处理的异常在 Microsoft.Speech.dll 中发生

    其他信息: Speak error '80004005'.”

    如果把speaker改为en-US之类的就不会出错。

    以上语言包已经安装过

    求解

    2016年9月20日 4:20

答案

全部回复

  • 你好,

    试试用下面的方法,看看你有没有安装相关的voiceinfo.

    // Initialize a new instance of the SpeechSynthesizer.
          using (SpeechSynthesizer synth = new SpeechSynthesizer())
          {
    
            // Output information about all of the installed voices. 
            Console.WriteLine("Installed voices -");
            foreach (InstalledVoice voice in synth.GetInstalledVoices())
            {
              VoiceInfo info = voice.VoiceInfo;
              Console.WriteLine(" Voice Name: " + info.Name);
            }
          }
    
          Console.WriteLine();
          Console.WriteLine("Press any key to exit...");
          Console.ReadKey();
    

    Best regards,

    Cole Wu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2016年9月20日 7:26
    版主
  •                 foreach (InstalledVoice voice in synth.GetInstalledVoices())
                    {
                        VoiceInfo info = voice.VoiceInfo;
                        Lists.Items.Add(new ListViewItem(new string[7] { info.Name ,
                                                                        info.Culture.ToString(),
                                                                        info.Age.ToString(),
                                                                        info.Gender.ToString(),
                                                                        info.Description,
                                                                        info.Id,
                                                                        voice.Enabled.ToString()}));

    您好,我刚刚尝试了这个,所有代码中提到的voiceinfo均已安装。

    几天前我只安装有en-US,Helen.当时代码一切正常。当我安装zh-CN HuiHui以后,无论synthesizer.SelectVoice选择了什么voice,都会出现Speak error 80004005错误,我把HuiHui语言包卸载以后又恢复正常了。然后我安装了zh-TW HanHan。这次我用synthesizer.SelectVoice选择Helen时不会报错。但选择HanHan时同样会出现80004005错误。

    我感觉很奇怪

    语言包版本号均为11.0.7400.335

    speech platform sdk(x86)版本号为11.0.7400.345

    本机windows 10 10586.589

    Microsoft Visual Studio Ultimate 2013
    版本 12.0.21005.1 REL
    Microsoft .NET Framework
    版本 4.6.01038
    • 已编辑 NexF 2016年9月21日 16:10
    2016年9月21日 15:38
  • 你好,

    这个可能是这个SDK的问题,我建议你可以到下面的文档页中发布一个反馈。拉到最底下,在“此页面有帮助吗?” 中点“否” 按钮,然后输入你的反馈内容,并提交.

    https://msdn.microsoft.com/zh-cn/library/hh362873%28v=office.14%29.aspx?f=255&MSPPError=-2147217396

    Best regards,

    Cole Wu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2016年9月23日 6:14
    版主