Joaco Terniro
Joaco Terniro

Reputation: 115

Can't listen audio - Microsoft.Speech.Synthesis (Spanish Voice Helena)

I'm working in an app where I'm using Microsoft.Speech.Synthesis Synthesizer. I'm trying to use a Spanish Voice (es-ES, Helena). The code is the following:

using Microsoft.Speech.Synthesis;
...
...

//Inside main method
SpeechSynthesizer synth = new SpeechSynthesizer();
List<InstalledVoice> installedVoices = new List<InstalledVoice>();
foreach (InstalledVoice voice in synth.GetInstalledVoices()){
        installedVoices.Add(voice);
        Console.WriteLine(voice.VoiceInfo.Name);
}
synth.SelectVoice(installedVoices[0].VoiceInfo.Name);
synth.Rate = 0;

synth.TtsVolume = 100;
synth.SpeakAsync("Hola Mundo");

Console.WriteLine();
Console.ReadKey();

The output in console is the following:

Microsoft Server Speech Text to Speech Voice (es-ES, Helena)

The problem is that the program doesn't speak. I can't listen the audio. Could anyone help me with this?

All help is appreciated.

Upvotes: 0

Views: 449

Answers (2)

RonnyR
RonnyR

Reputation: 230

I had the same problem, everything was installed correctly, output set to DefaultAudioDevice, and still no sound.

For some reason what solved it for me was setting my audio from 5.1 to Stereo. Maybe it was because I used headphones.

Upvotes: 0

nvoigt
nvoigt

Reputation: 77354

You seem to miss the output settings.

// Configure the synthesizer to send output to the default audio device.
synth.SetOutputToDefaultAudioDevice();

This will set the output to the system's default audio device.

Upvotes: 0

Related Questions