This topic has not yet been rated - Rate this topic

InstalledVoice Class

Represents an installed Voice object.

Namespace:  System.Speech.Synthesis
Assembly:  System.Speech (in System.Speech.dll)
public class InstalledVoice
System.Object
  System.Speech.Synthesis.InstalledVoice
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Sample using PowerShell
<#
.SYNOPSIS
This script displays the installed Speech Synthesiser voices
.DESCRIPTION
This script first loads the System.Speech DLL, then
creates a new SpeechSynthesizer object. It uses this
object to enumerate the installed speech voices.
.NOTES
File Name : Get-InstalledVoice.ps1
Author : Thomas Lee - tfl@psp.co.uk
Requires : PowerShell Version 2.0
.LINK
This script posted to:
http://www.pshscripts.blogspot.com
MSDN Sample posted at:
http://msdn.microsoft.com/en-us/library/system.speech.synthesis.installedvoice%28VS.90%29.aspx
.EXAMPLE
PSH [C:\foo]: .\Get-InstalledVoice.ps1
    Gender                : Female
Age : Adult
Name : Microsoft Anna
Culture : en-US
Id : MS-Anna-1033-20-DSK
Description : Microsoft Anna - English (United States)
SupportedAudioFormats : {System.Speech.AudioFormat.SpeechAudioFormatInfo}
AdditionalInfo : {[Age, Adult], [AudioFormats, 18], [Gender, Female], [Language, 409]...}
#>
#
# First load the dll
$r = [system.Reflection.Assembly]::LoadWithPartialName("system.speech")
# Create a speech synthesizer object and enumerate voices
$spk = New-Object system.Speech.Synthesis.SpeechSynthesizer
$spk.GetInstalledVoices() | %{$_.voiceinfo}
InstalledVoice
SpeechSynthesizer spk = new SpeechSynthesizer();
foreach (InstalledVoice voice in spk.GetInstalledVoices())
{
    // voice.VoiceInfo.Name
}