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.