lexicon Element SSML (Microsoft.Speech)
Specifies an external pronunciation lexicon file.
Required. Specifies the location of the pronunciation lexicon, which is a relative URI or an absolute URI.
Optional. Specifies the media type of the pronunciation lexicon document. The Microsoft Speech Platform SDK 11 currently supports two values:
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 use lexicons to create custom pronunciations for specialized vocabulary in your application. 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 using the phoneme Element (Microsoft.Speech) 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).
The lexicon element is an immediate child of the speak Element (Microsoft.Speech). Multiple lexicon elements can occur in a Speech Synthesis Markup Language (SSML) document. If there are references to multiple lexicons, the order in which they are listed dictates their priority. Speech synthesis (TTS) engines use lexicons of higher priority first when determining which pronunciations to use.
The pronunciation information provided by a lexicon is specific to the single language declared in the xml:lang attribute of the speak element, and is used only for content defined within the enclosing SSML document.
The following example specifies a lexicon that defines a pronunciation for an uncommon word: whatchamacallit. Typically, you would use the phoneme Element (Microsoft.Speech)to specify a pronunciation for a single occurrence of an uncommon word. However, this example demonstrates how to attach a lexicon to an SSML prompt and how the pronunciation defined in a lexicon may improve the speech synthesizer's pronunciation of an uncommon word. A custom lexicon overrides the pronunciations in the speech synthesizer's internal lexicon and applies to all occurrences of the words it defines.
<?xml version="1.0"?> <speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"> <lexicon uri="c:\Test\whatchamacallit.pls" type="application/pls+xml"/> Gimme the whatchamacallit. </speak>
The following are the contents of the SSML prompt file whatchamacallit.pls.