SpeechSynthesizer::AddLexicon Method
Adds a lexicon to the SpeechSynthesizer object.
Assembly: System.Speech (in System.Speech.dll)
Parameters
- uri
- Type: System::Uri
The location of the lexicon information.
- mediaType
- Type: System::String
The media type of the lexicon. Media type values are not case sensitive.
A pronunciation lexicon is a collection of words or phrases together with their pronunciations, which consist of letters and characters from a supported phonetic alphabet. You can add multiple lexicons to a SpeechSynthesizer.
Two values are currently supported for mediaType:
The value application/vdn.ms-sapi-lex indicates that the lexicon format is Uncompressed Lexicon, which is specific to the System.Speech API.
The value application/pls+xml indicates that the lexicon conforms to the Pronunciation Lexicon Specification (PLS) Version 1.0. See Lexicons and Phonetic Alphabets for more information.
Pronunciations specified in an external lexicon file take precedence over the pronunciations of the speech synthesizer's internal lexicon or dictionary. However, pronunciations specified inline in prompts created with any of the AppendTextWithPronunciation(String, String), AppendSsmlMarkup(String), or AppendSsml() methods take precedence over pronunciations specified in any lexicon. Inline pronunciations apply only to a single occurrence of a word.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.