Get Installed Speech Voices in WPF


The GetInstalledVoices method of SpeechSynthesizer class returns all installed voices on a machine. This method returns a collection of InstalledVoice object. You can use Age, Name, ID and other members of InstalledVoice to get their name, age, and ID.

The following code snippet gets all installed voices and adds them to a ComobBox.

SpeechSynthesizer talker = new SpeechSynthesizer();

// Load all installed voices

System.Collections.ObjectModel.ReadOnlyCollection<InstalledVoice>

    voices = talker.GetInstalledVoices();

foreach (InstalledVoice voice  in voices)

{

    VoicesComboBox.Items.Add(voice.VoiceInfo.Name);

}Note: Before you can use this class in your application, read my article for more details:
Programming Speech in WPF - Speech Synthesis


Similar Articles
Mindcracker
Founded in 2003, Mindcracker is the authority in custom software development and innovation. We put best practices into action. We deliver solutions based on consumer and industry analysis.