Enumerating TTS Engines using System.Speech.Synthesizer
Here is a quick and dirty C# console application that will list out the installed TTS engines and associated properties. Make sure you add System.Speech to your project's list of references.
using System;
using System.Collections.Generic;
using System.Speech;
using System.Speech.Synthesis;
using System.Speech.AudioFormat;
namespace SelectVoice
{
class SelectVoice
{
static void Main(string[] args)
{
Console.WriteLine("SelectVoice Example");
SpeechSynthesizer ttsSynth = new SpeechSynthesizer();
Console.WriteLine("Listing installed speech synthesizer voices...");
foreach (InstalledVoice ttsVoice in ttsSynth.GetInstalledVoices())
{
Console.WriteLine("Name:\t{0}", ttsVoice.VoiceInfo.Name);
Console.WriteLine("Desc:\t{0}", ttsVoice.VoiceInfo.Description);
Console.WriteLine("Id:\t{0}", ttsVoice.VoiceInfo.Id);
Console.WriteLine("Gender:\t{0}", ttsVoice.VoiceInfo.Gender);
Console.WriteLine("Age:\t{0}", ttsVoice.VoiceInfo.Age);
Console.WriteLine("Supported Audio Formats:");
foreach (SpeechAudioFormatInfo audioFormat in ttsVoice.VoiceInfo.SupportedAudioFormats)
{
Console.WriteLine("\tEncodingFormat:\t{0}", audioFormat.EncodingFormat);
Console.WriteLine("\tChannelCount:\t{0}", audioFormat.ChannelCount);
Console.WriteLine("\tBits/sec:\t{0}", audioFormat.BitsPerSample);
Console.WriteLine("\tAvg Bytes/sec:\t{0}", audioFormat.AverageBytesPerSecond);
Console.WriteLine("\tSamples/sec:\t{0}", audioFormat.SamplesPerSecond);
Console.WriteLine("\tBlockAlign:\t{0}", audioFormat.BlockAlign);
}
Console.WriteLine("Additional Information:");
foreach(KeyValuePair<string, string> kvp in ttsVoice.VoiceInfo.AdditionalInfo)
Console.WriteLine("\t{0}: {1}", kvp.Key, kvp.Value);
Console.WriteLine();
}
Console.WriteLine("Finished listing installed voices.");
ttsSynth.SelectVoice("Microsoft Anna");
ttsSynth.Speak("Greetings, my name is " + ttsSynth.Voice.Name);
}
}
}