次の方法で共有


speak Element

The required root element of a Speech Synthesis Markup Language (SSML) document.

Syntax

<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="string"> </speak>

Attributes

Attribute

Description

version

Required. Indicates the version of the World Wide Web Consortium Speech Synthesis Markup Language (SSML) Version 1.0 specification used to interpret the document markup. The current version is 1.0.

xml:lang

Required. Specifies the language of the root document. The value may contain either a lower-case, two-letter language code, (such as en for English), or may optionally include an upper-case, country/region or other variation in addition to the language code, (such as zh-CN).

xmlns

Required. Specifies the URI to the document that defines the markup vocabulary (the element types and attribute names) of the SSML document.

The current URI is http://www.w3.org/2001/10/synthesis.

Remarks

A valid SSML document must contain the root element speak.

For a given language code specified in the xml:lang attribute, a speech synthesis engine that supports that language code must be installed to correctly pronounce words in the specified language.

If the speak element specifies only a language code, and not a country/region code, for the xml:lang attribute (such as xml:lang="en"), then any installed synthesis engine that expresses support for that generic, region-independent language may produce acceptable pronunciations for words in the specified language.

The other elements in the SSML document that also take the xml:lang attribute (voice, p, and s) may declare different languages than the language declared in the speak element. The System.Speech.Synthesis namespace supports multiple languages in SSML documents.

Microsoft Windows and the System.Speech API accept all valid language-country codes, but only a limited number of text-to-speech (TTS) engines are provided with Windows 7. The TTS engines that are shipped with Windows 7 work with the following language codes.

  • en-US. English (United States)

  • zh-CN. Chinese (China)

  • zh-TW. Chinese (Taiwan)

Two-letter language codes such as "en" are also permitted.

Example

The following example demonstrates the minimum required attributes for the speak element in an SSML prompt.

<?xml version="1.0" encoding="ISO-8859-1"?>
<speak version="1.0"
 xmlns="http://www.w3.org/2001/10/synthesis"
 xml:lang="en-US">

  This is the text that will be spoken by the application.

</speak>