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?
Because you're using two different TTS engines. Microsoft.Speech uses the server TTS voices; System.Speech uses the desktop TTS voices. See the discussion here.
Windows Vista and above have desktop TTS voices registered by default, but no server TTS voices. When you install the Server Speech Platform Runtime, which I believe you have to do in order to get the Microsoft.Speech.dll loaded in the first place, you should have the option to install some server TTS voices as well.