Getting the installed Text to Speech (TTS) voices.
To get a list of installed Text to Speech voices, create a SpeechSynthesizer class.
System.Speech.Synthesis.SpeechSynthesizer Speaker = new System.Speech.Synthesis.SpeechSynthesizer();
Add a combobox control to the form. Create a getVoices function as below.
void getVoices()
{
foreach (System.Speech.Synthesis.InstalledVoice vi in Speaker.GetInstalledVoices())
{
this.comboBox1.Items.Add(vi.VoiceInfo.Name);
}
}
On the forms load event, call the getVoices function.
private void Form1_Load(object sender, EventArgs e)
{
getVoices();
}
|