Adds a lexicon to the SpeechSynthesizer object.
Namespace:
Microsoft.Speech.Synthesis
Assembly:
Microsoft.Speech (in Microsoft.Speech.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Sub AddLexicon ( _ uri As Uri, _ mediaType As String _ ) |
Visual Basic (Usage) |
---|
Dim instance As SpeechSynthesizer Dim uri As Uri Dim mediaType As String instance.AddLexicon(uri, mediaType) |
C# |
---|
public void AddLexicon( Uri uri, string mediaType ) |
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.
Remarks
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 Microsoft Speech API.
The value application/pls+xml indicates that the lexicon conforms to the Pronunciation Lexicon Specification (PLS) Version 1.0.
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(XmlReader) methods take precedence over pronunciations specified in any lexicon. Inline pronunciations apply only to a single occurrence of a word. For more information, see Lexicons and Phonetic Alphabets (Microsoft.Speech).