Question

I have installed Microsoft Speech Platform SDK and Runtime and two language packs for English and Russian. My code

 SpeechSynthesizer synthesizer = new SpeechSynthesizer();
        synthesizer.Volume = 100;  // 0...100
        synthesizer.TtsVolume = 100;
        synthesizer.Rate = 0;     // -10...10
        foreach (InstalledVoice voice in synthesizer.GetInstalledVoices()) {
            VoiceInfo info = voice.VoiceInfo;
            Console.WriteLine(" Voice Name: " + info.Name);
            synthesizer.SelectVoice(info.Name);
            synthesizer.SpeakStarted += SPeackStarted;
            synthesizer.Speak("Hello");
            Console.ReadKey();
        }

But it doesn't speak. What am I doing wrong?

Was it helpful?

Solution

i think you still need to configure the audio output.

you can do it like this:

  SpeechSynthesizer synthesizer = new SpeechSynthesizer();
  synthesizer.SetOutputToDefaultAudioDevice();

for more info:

http://msdn.microsoft.com/en-us/library/system.speech.synthesis.speechsynthesizer%28v=vs.110%29.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top