Reputation: 21
This is what I have to make a simple Text-to-Speech application. This works fine.
static void Main(string[] args)
{
SpeechSynthesizer ss = new SpeechSynthesizer();
string file = @"C:\test.wav";
ss.SetOutputToWaveFile(file, new SpeechAudioFormatInfo(16000, AudioBitsPerSample.Sixteen, AudioChannel.Mono));
PromptBuilder pb = new PromptBuilder();
pb.StartVoice("Microsoft David Desktop");
pb.AppendSsmlMarkup("Hello world");
pb.EndVoice();
ss.Speak(pb);
Console.ReadLine();
}
Now my question is if I can use a voice other than the Microsoft voices to speak the text out loud. Like L&H Michael or Michelle, voices that are SAPI compliant.
I tried doing it with L&H Michael or Michelle, but instead of using these voices the application just uses the default Microsoft voice.
Upvotes: 0
Views: 1044
Reputation: 41
I mostly use SAPI SDK 11 or System.Speech, but have you tried using .GetInstalledVoices to make sure you have installed what you expect and then use .SelectVoice to set it. Here is an example for .GetInstalledVoices: https://msdn.microsoft.com/en-us/library/system.speech.synthesis.voiceinfo(v=vs.110).aspx and this from here on stack: how I can change the voice synthesizer gender and age in C#?. Use .SelectVoice instead of .SelectVoiceByHints if you want a specific voice:
synthesizer.SelectVoice("Microsoft Server Speech Text to Speech Voice (en-US, Helen)");
Upvotes: 0