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

Up Next
    Ebook Download
    View all
    Learn
    View all