I just try to run simple microsoft example for Text To Speech using using Microsoft.Speech.dll;
using System;
using Microsoft.Speech.Synthesis;
namespace TTS
{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Testing TTS!");
// 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);
}
// Select the US English voice.
synth.SelectVoice("Microsoft Server Speech Text to Speech Voice (en-GB, Hazel)");
// Build a prompt.
PromptBuilder builder = new PromptBuilder();
builder.AppendText("That is a big pizza!");
// Speak the prompt.
synth.Speak(builder);
}
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
}
}
Although I have the right voices, it does not make any sound. No Text To Speech(TTS) voice.
When I use Microsoft System.Speech.dll then I can hear voice. So there is no sound problem.
using System;
using System.Speech.Synthesis;
namespace TTS
{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Testing TTS!");
// 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);
}
// Build a prompt.
PromptBuilder builder = new PromptBuilder();
builder.AppendText("That is a big pizza!");
// Speak the prompt.
synth.Speak(builder);
}
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
}
}
Shortly
Why I can not hear any voice or make Text To Speech(TTS) with Microsoft Speech Platform using Microsoft.Speech? Should I do some extra config?