4

I just installed the Microsoft speech SDK 11 and added 2 different Runtime languages for english and chinese.

English seems to run fine, though chinese throws me this error

System.InvalidOperationException

with additional information

Speak error '80004005'

for the line

synth.Speak(s);

in the following code

using System;
using Microsoft.Speech.Synthesis;

namespace SampleSynthesis
{
    class Program
    {
        static void Main(string[] args)
        {
            speakString(0, "Hello, I'm TTS.");
        }

        static void speakString(int i, String s)
        {
            // Initialize a new instance of the SpeechSynthesizer.
            SpeechSynthesizer synth = new SpeechSynthesizer();

            // Select a voice. 
            switch (i)
            {
                case 0:
                    synth.SelectVoice("Microsoft Server Speech Text to Speech Voice (en-US, ZiraPro)");
                    break;
                case 1:
                    synth.SelectVoice("Microsoft Server Speech Text to Speech Voice (zh-CN, HuiHui)");
                    break;
            }

            // Configure the audio output. 
            synth.SetOutputToWaveFile(@"C:\Users\David\Desktop\TTStest\test.wav");

            synth.Speak(s);
        }
    }
}

In another question I found this answer, which states that there are crucial files missing in (since?) windows 8.1, but doesn't state any method for how to acquire these.

I am currently using a 64bit version of windows 10.

EDIT: I downloaded the files chsbrkr.dll and chtbrkr.dll and get the following new error

An unhandled exception of type 'System.InvalidCastException' occurred in Microsoft.Speech.dll

again for the same line in my code.

Community
  • 1
  • 1
hatero
  • 89
  • 2
  • 8
  • Did you solve your issue ? I encounter the same issue... thanks. – Adavo May 31 '16 at 01:14
  • No, I did not find a solution. – hatero Jun 01 '16 at 08:30
  • I found this question after having the same problem with Japanese (Windows 10, Speech v11). I don't have access to the DLLs to give them a try (and they might be for Chinese only), so I have no idea if it would solve the issue. – briantist Jul 08 '17 at 21:25

1 Answers1

1

As posted by tofutim: https://stackoverflow.com/a/28042294/1212314

Between Windows 8.1 and Windows 8.0, two files were dropped that are critical for using the Server Speech API. These are chsbrkr.dll and chtbrkr.dll which will be in the Windows directory in Windows 8.0. It is also important to choose the x86 vs x64 versions from Windows depending on your SDK and Windows 8.0 version (x86 vs x64). For example, in a 64-bit Windows 8.1 environment, using 32-bit dll's, you should place the two files in

C:\Program Files (x86)\Common Files\Microsoft Shared\Speech\TTS\v11.0

Hopefully, Microsoft will fix these (though I am told they will not) or officially allow for distribution (good luck...).

BTW, you should not see this error in Windows XP through Windows 8.0.

Update. I believe these files are used to break up Chinese into chunks for the TTS to handle. Without them, the Chinese TTS will fail with the error posted.

Community
  • 1
  • 1
egfconnor
  • 2,637
  • 1
  • 26
  • 44
  • Uh, it's been some time since my question, but when I downloaded those files I got the error message stated in the edit. – hatero May 03 '17 at 13:44
  • Gotcha. I was trying to use it on Windows 10 and could never get any Chinese to be spoken until I put those files in the directory and then it started working. – egfconnor May 03 '17 at 15:13