lexicon Element SSML (Microsoft.Speech)

Microsoft Speech Platform SDK 11

Collapse image Expand Image Copy image CopyHover image

Specifies an external pronunciation lexicon file.

Syntax

XML Copy imageCopy Code
<lexicon
    uri = lexiconURI
    type = mediaType />

Attributes

Attribute

Description

uri

Required. Specifies the location of the pronunciation lexicon, which is a relative URI or an absolute URI.

type

Optional. Specifies the media type of the pronunciation lexicon document. Microsoft.Speech currently supports two values.

The value application/vdn.ms-sapi-lex indicates the lexicon format is "Uncompressed Lexicon", which was created by Microsoft.

The value application/pls+xml indicates that the lexicon conforms to the Pronunciation Lexicon Specification (PLS) Version 1.0 specification.

Remarks

The lexicon element is an immediate child of the speak element. 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.

Example

XML Copy imageCopy Code
<?xml version="1.0"?>
<!DOCTYPE speak PUBLIC "-//W3C//DTD SYNTHESIS 1.0//EN"
                  "http://www.w3.org/TR/speech-synthesis/synthesis.dtd">
<speak version="1.0"
  xmlns="http://www.w3.org/2001/10/synthesis"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.w3.org/2001/10/synthesis
  http://www.w3.org/TR/speech-synthesis/synthesis.xsd"
  xml:lang="en-US">

  <lexicon uri="http://www.contoso.com/lexicon.lex" type="application/vdn.ms-sapi-lex"/>
  <lexicon uri="http://www.contoso.com/lexicon2.lex" type="application/pls+xml"/>
  
<!-- Content for the prompt goes here -->

</speak>