SpeechSynthesizer..::..GetInstalledVoices Method (CultureInfo) |
SpeechSynthesizer Class See Also Send Feedback |
Returns all of the installed speech synthesis (text-to-speech) voices that support a specific locale.
Namespace:
Microsoft.Speech.Synthesis
Assembly:
Microsoft.Speech (in Microsoft.Speech.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Function GetInstalledVoices ( _ culture As CultureInfo _ ) As ReadOnlyCollection(Of InstalledVoice) |
Visual Basic (Usage) |
---|
Dim instance As SpeechSynthesizer Dim culture As CultureInfo Dim returnValue As ReadOnlyCollection(Of InstalledVoice) returnValue = instance.GetInstalledVoices(culture) |
C# |
---|
public ReadOnlyCollection<InstalledVoice> GetInstalledVoices( CultureInfo culture ) |
Parameters
- culture
- Type: System.Globalization..::..CultureInfo
The locale that the voice must support.
Return Value
Type: System.Collections.ObjectModel..::..ReadOnlyCollection<(Of <(<'InstalledVoice>)>)>Returns a read-only collection of the voices currently installed on the system that support the specified locale.
Remarks
If none of the installed voices support the specified locale, this method returns an empty collection.
The Microsoft Speech Platform SDK 11 accepts all valid language-country codes as values for culture. For a given language code specified in the culture parameter, a speech synthesis engine that supports that language code must be installed to correctly pronounce words in the specified language.
If the culture parameter specifies only a language code, (such as "en" for English or "es" for Spanish), and not a country/region code, then any installed speech synthesis voice that expresses support for that generic, region-independent language may produce acceptable pronunciations for words in the specified language. See Language Identifier Constants and Strings for a comprehensive list of language codes.