Copyright © 2007 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
The Voice Browser Working Group has sought to develop standards to enable access to the Web using spoken interaction. The Speech Synthesis Markup Language Specification is one of these standards and is designed to provide a rich, XML-based markup language for assisting the generation of synthetic speech in Web and other applications. The essential role of the markup language is to provide authors of synthesizable content a standard way to control aspects of speech such as pronunciation, volume, pitch, rate, etc. across different synthesis-capable platforms.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This is the 12 December 2007 Working Draft of "Speech Synthesis Markup Language (SSML) Version 1.1". Changes from the previous Working Draft can be found in Appendix G.
This document enhances SSML 1.0 [SSML] to provide better support for a broader set of natural (human) languages. To determine in what ways, if any, SSML is limited by its design with respect to supporting languages that are in large commercial or emerging markets for speech synthesis technologies but for which there was limited or no participation by either native speakers or experts during the development of SSML 1.0, the W3C held three workshops on the Internationalization of SSML. The first workshop [WS], in Beijing, PRC, in October 2005, focused primarily on Chinese, Korean, and Japanese languages, and the second [WS2], in Crete, Greece, in May 2006, focused primarily on Arabic, Indian, and Eastern European languages. The third workshop [WS3], in Hyderabad, India, in January 2007, focused heavily on Indian and Middle Eastern languages. Information collected during these workshops was used to develop a requirements document [REQS11]. Changes from SSML 1.0 are motivated by these requirements.
This document is a W3C Working Draft. It has been produced as part of the Voice Browser Activity. The authors of this document are participants in the Voice Browser Working Group. For more information see the Voice Browser FAQ. The Working Group expects to advance this Working Draft to Recommendation status.
Comments are welcome on www-voice@w3.org (archive). See W3C mailing list and archive usage guidelines. Please send comments by 10 January 2008.
Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
This W3C specification is known as the Speech Synthesis Markup Language specification (SSML) and is based upon the JSGF and/or JSML specifications, which are owned by Sun Microsystems, Inc., California, U.S.A. The JSML specification can be found at [JSML].
SSML is part of a larger set of markup specifications for voice browsers developed through the open processes of the W3C. It is designed to provide a rich, XML-based markup language for assisting the generation of synthetic speech in Web and other applications. The essential role of the markup language is to give authors of synthesizable content a standard way to control aspects of speech output such as pronunciation, volume, pitch, rate, etc. across different synthesis-capable platforms. A related initiative to establish a standard system for marking up text input is SABLE [SABLE], which tried to integrate many different XML-based markups for speech synthesis into a new one. The activity carried out in SABLE was also used as the main starting point for defining the Speech Synthesis Markup Requirements for Voice Markup Languages [REQS]. Since then, SABLE itself has not undergone any further development.
The intended use of SSML is to improve the quality of synthesized content. Different markup elements impact different stages of the synthesis process (see Section 1.2). The markup may be produced either automatically, for instance via XSLT or CSS3 from an XHTML document, or by human authoring. Markup may be present within a complete SSML document (see Section 2.2.2) or as part of a fragment (see Section 2.2.1) embedded in another language, although no interactions with other languages are specified as part of SSML itself. Most of the markup included in SSML is suitable for use by the majority of content developers; however, some advanced features like phoneme and prosody (e.g. for speech contour design) may require specialized knowledge.
The design and standardization process has followed from the Speech Synthesis Markup Requirements for Voice Markup Languages [REQS].
The following items were the key design criteria.
A Text-To-Speech system (a synthesis processor) that supports SSML will be responsible for rendering a document as spoken output and for using the information contained in the markup to render the document as intended by the author.
Document creation: A text document provided as input to the synthesis processor may be produced automatically, by human authoring, or through a combination of these forms. SSML defines the form of the document.
Document processing: The following are the six major processing steps undertaken by a synthesis processor to convert marked-up text input into automatically generated voice output. The markup language is designed to be sufficiently rich so as to allow control over each of the steps described below so that the document author (human or machine) can control the final voice output. Although each step below is divided into "markup support" and "non-markup behavior", actual behavior is usually a mix of the two and varies depending on the tag. The processor has the ultimate authority to ensure that what it produces is pronounceable (and ideally intelligible). In general the markup provides a way for the author to make prosodic and other information available to the processor, typically information the processor would be unable to acquire on its own. It is then up to the processor to determine whether and in what way to use the information.
XML parse: An XML parser is used to extract the document tree and content from the incoming text document. The structure, tags and attributes obtained in this step influence each of the following steps.
Structure analysis: The structure of a document influences the way in which a document should be read. For example, there are common speaking patterns associated with paragraphs and sentences.
Markup support: The p and s elements defined in SSML explicitly indicate document structures that affect the speech output.
Non-markup behavior: In documents and parts of documents where these elements are not used, the synthesis processor is responsible for inferring the structure by automated analysis of the text, often using punctuation and other language-specific data.
Text normalization: All written languages have special constructs that require a conversion of the written form (orthographic form) into the spoken form. Text normalization is an automated process of the synthesis processor that performs this conversion. For example, for English, when "$200" appears in a document it may be spoken as "two hundred dollars". Similarly, "1/2" may be spoken as "half", "January second", "February first", "one of two" and so on. By the end of this step the text to be spoken has been converted completely into tokens. The exact details of what constitutes a token are language-specific. In English, tokens are usually separated by white space and are typically words. For languages with different tokenization behavior, the term "word" in this specification is intended to mean an appropriately comparable unit. Tokens in SSML cannot span markup tags except within the token and w elements. A simple English example is "cup<break/>board"; outside the token and w elements, the synthesis processor will treat this as the two tokens "cup" and "board" rather than as one token (word) with a pause in the middle. Breaking one token into multiple tokens this way will likely affect how the processor treats it.
Markup support: The say-as element can be used in the input document to explicitly indicate the presence and type of these constructs and to resolve ambiguities. The set of constructs that can be marked has not yet been defined but might include dates, times, numbers, acronyms, currency amounts and more. Note that many acronyms and abbreviations can be handled by the author via direct text replacement or by use of the sub element, e.g. "BBC" can be written as "B B C" and "AAA" can be written as "triple A". These replacement written forms will likely be pronounced as one would want the original acronyms to be pronounced. In the case of Japanese text, if you have a synthesis processor that supports both Kanji and kana, you may be able to use the sub element to identify whether 今日は should be spoken as きょうは ("kyou wa" = "today") or こんにちは ("konnichiwa" = "hello").
Non-markup behavior: For text content that is not marked with the say-as element the synthesis processor is expected to make a reasonable effort to automatically locate and convert these constructs to a speakable form. Because of inherent ambiguities (such as the "1/2" example above) and because of the wide range of possible constructs in any language, this process may introduce errors in the speech output and may cause different processors to render the same document differently.
Text-to-phoneme conversion: Once the synthesis processor has determined the set of tokens to be spoken, it must derive pronunciations for each token. Pronunciations may be conveniently described as sequences of phonemes, which are units of sound in a language that serve to distinguish one word from another. Each language (and sometimes each national or dialect variant of a language) has a specific phoneme set: e.g., most US English dialects have around 45 phonemes, Hawai'ian has between 12 and 18 (depending on who you ask), and some languages have more than 100! This conversion is made complex by a number of issues. One issue is that there are differences between written and spoken forms of a language, and these differences can lead to indeterminacy or ambiguity in the pronunciation of written words. For example, compared with their spoken form, words in Hebrew and Arabic are usually written with no vowels, or only a few vowels specified. In many languages the same written word may have many spoken forms. For example, in English, "read" may be spoken as "reed" (I will read the book) or "red" (I have read the book). Both human speakers and synthesis processors can pronounce these words correctly in context but may have difficulty without context (see "Non-markup behavior" below). Another issue is the handling of words with non-standard spellings or pronunciations. For example, an English synthesis processor will often have trouble determining how to speak some non-English-origin names, e.g. "Caius College" (pronounced "keys college") and President Tito (pronounced "sutto"), the president of the Republic of Kiribati (pronounced "kiribass").
Markup support: The phoneme element allows a phonemic sequence to be provided for any token or token sequence. This provides the content creator with explicit control over pronunciations. The say-as element might also be used to indicate that text is a proper name that may allow a synthesis processor to apply special rules to determine a pronunciation. The lexicon and lookup elements can be used to reference external definitions of pronunciations. These elements can be particularly useful for acronyms and abbreviations that the processor is unable to resolve via its own text normalization and that are not addressable via direct text substitution or the sub element (see paragraph 3, above).
Non-markup behavior: In the absence of a phoneme element the synthesis processor MUST apply automated capabilities to determine pronunciations. This is typically achieved by looking up tokens in a pronunciation dictionary (which may be language-dependent) and applying rules to determine other pronunciations. Synthesis processors are designed to perform text-to-phoneme conversions so most words of most documents can be handled automatically. As an alternative to relying upon the processor, authors may choose to perform some conversions themselves prior to encoding in SSML. Written words with indeterminate or ambiguous pronunciations could be replaced by words with an unambiguous pronunciation; for example, in the case of "read", "I will reed the book". Authors should be aware, however, that the resulting SSML document may not be optimal for visual display.
Prosody analysis: Prosody is the set of features of speech output that includes the pitch (also called intonation or melody), the timing (or rhythm), the pausing, the speaking rate, the emphasis on words and many other features. Producing human-like prosody is important for making speech sound natural and for correctly conveying the meaning of spoken language.
Markup support: The emphasis element, break element and prosody element may all be used by document creators to guide the synthesis processor in generating appropriate prosodic features in the speech output.
Non-markup behavior: In the absence of these elements, synthesis processors are expert (but not perfect) in automatically generating suitable prosody. This is achieved through analysis of the document structure, sentence syntax, and other information that can be inferred from the text input.
While most of the elements of SSML can be considered high-level in that they provide either content to be spoken or logical descriptions of style, the break and prosody elements mentioned above operate at a later point in the process and thus must coexist both with uses of the emphasis element and with the processor's own determinations of prosodic behavior. Unless specified in the appropriate sections, details of the interactions between the processor's own determinations and those provided by the author at this level are processor-specific. Authors are encouraged not to casually or arbitrarily mix these two levels of control.
Waveform production: The phonemes and prosodic information are used by the synthesis processor in the production of the audio waveform. There are many approaches to this processing step so there may be considerable processor-specific variation.
Markup support: The voice element allows the document creator to request a particular voice or specific voice qualities (e.g. a young male voice). The audio element allows for insertion of recorded audio data into the output stream, with optional control over the duration, soundlevel and playback speed of the recording. Rendering can be restricted to a subset of the document by using the trimming attributes on the speak element.
Non-markup behavior: The default volume/soundlevel, speed, and pitch/frequency of both voices and recorded audio in the document are that of the unmodified waveforms, whether they be voices or recordings.
There are many classes of document creator that will produce marked-up documents to be spoken by a synthesis processor. Not all document creators (including human and machine) have access to information that can be used in all of the elements or in each of the processing steps described in the previous section. The following are some of the common cases.
The document creator has no access to information to mark up the text. All processing steps in the synthesis processor must be performed fully automatically on raw text. The document requires only the containing speak element to indicate the content is to be spoken.
When marked text is generated programmatically the creator may have specific knowledge of the structure and/or special text constructs in some or all of the document. For example, an email reader can mark the location of the time and date of receipt of email. Such applications may use elements that affect structure, text normalization, prosody and possibly text-to-phoneme conversion.
Some document creators make considerable effort to mark as many details of the document as possible to ensure consistent speech quality across platforms and to more precisely specify output qualities. In these cases, the markup may use any or all of the available elements to tightly control the speech output. For example, prompts generated in telephony and voice browser applications may be fine-tuned to maximize the effectiveness of the overall system.
The most advanced document creators may skip the higher-level markup (structure, text normalization, text-to-phoneme conversion, and prosody analysis) and produce low-level speech synthesis markup for segments of documents or for entire documents. This typically requires tools to generate sequences of phonemes, plus pitch and timing information. For instance, tools that do "copy synthesis" or "prosody transplant" try to emulate human speech by copying properties from recordings.
The following are important instances of architectures or designs from which marked-up synthesis documents will be generated. The language design is intended to facilitate each of these approaches.
Dialog language: It is a requirement that it SHOULD be possible to include documents marked with SSML into the dialog description document to be produced by the Voice Browser Working Group.
Interoperability with aural CSS (ACSS): Any HTML processor that is aural CSS-enabled can produce SSML. ACSS is covered in Section 19 of the Cascading Style Sheets, level 2 (CSS2) Specification [CSS2 §19]. This usage of speech synthesis facilitates improved accessibility to existing HTML and XHTML content.
Application-specific style sheet processing: As mentioned above, there are classes of applications that have knowledge of text content to be spoken, and that can be incorporated into the speech synthesis markup to enhance rendering of the document. In many cases, it is expected that the application will use style sheets to perform transformations of existing XML documents to SSML. This is equivalent to the use of ACSS with HTML and once again SSML is the resulting representation to be passed to the synthesis processor. In this context, SSML may be viewed as a superset of ACSS [CSS2§19] capabilities, excepting spatial audio.
SSML provides a standard way to specify gross properties of synthetic speech production such as pronunciation, volume, pitch, rate, etc. Exact specification of synthetic speech output behavior across disparate processors, however, is beyond the scope of this document.
Unless otherwise specified, markup values are merely indications rather than absolutes. For example, it is possible for an author to explicitly indicate the duration of a text segment and also indicate an explicit duration for a subset of that text segment. If the two durations result in a text segment that the synthesis processor cannot reasonably render, the processor is permitted to modify the durations as needed to render the text segment.
anyURI primitive as defined in XML Schema Part 2: Datatypes [SCHEMA2 §3.2.17]. For informational purposes only, [RFC3986] and [RFC2732] may be useful in understanding the structure, format, and use of URIs. Note that IRIs (see [RFC3987]) are permitted within the above definition of URI. Any relative URI reference MUST be resolved according to the rules given in Section 3.1.3.1. In this specification URIs are provided as attributes to elements, for example in the audio and lexicon elements.A legal stand-alone Speech Synthesis Markup Language document MUST have a legal XML Prolog [XML 1.0 or XML 1.1, as appropriate, §2.8]. If present, the OPTIONAL DOCTYPE MUST read as follows:
<!DOCTYPE speak PUBLIC "-//W3C//DTD SYNTHESIS 1.0//EN" "http://www.w3.org/TR/speech-synthesis/synthesis.dtd">
The XML prolog is followed by the root speak element. See Section 3.1.1 for details on this element.
The speak element MUST designate the SSML namespace. This can be achieved by declaring an xmlns attribute or an attribute with an "xmlns" prefix. See [XMLNS 1.0 or XMLNS 1.1, as appropriate, §2] for details. Note that when the xmlns attribute is used alone, it sets the default namespace for the element on which it appears and for any child elements. The namespace for SSML is defined to be http://www.w3.org/2001/10/synthesis.
It is RECOMMENDED that the speak element also indicate the location of the SSML schema (see Appendix D) via the xsi:schemaLocation attribute from [SCHEMA1 §2.6.3]. Although such indication is not required, to encourage it this document provides such indication on all of the examples.
The following are two examples of legal SSML headers:
<?xml version="1.0"?>
<speak version="1.1" 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">
<?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.1" xmlns="http://www.w3.org/2001/10/synthesis"
xml:lang="en-US">
The meta, metadata and lexicon elements MUST occur before all other elements and text contained within the root speak element. There are no other ordering constraints on the elements in this specification.
A document fragment is a Conforming Speech Synthesis Markup Language Fragment if:
xml:lang and xml:base , all non-synthesis namespace elements and attributes and all xmlns attributes which refer to non-synthesis namespace elements are removed from the document,xmlns attribute, then xmlns="http://www.w3.org/2001/10/synthesis" is added to the element.A document is a Conforming Stand-Alone Speech Synthesis Markup Language Document if it meets both the following conditions:
The SSML specification and these conformance criteria provide no designated size limits on any aspect of synthesis documents. There are no maximum values on the number of elements, the amount of character data, or the number of characters in attribute values.
The synthesis namespace MAY be used with other XML namespaces as per the appropriate Namespaces in XML Recommendation (1.0 [XMLNS 1.0] or 1.1 [XMLNS 1.1], depending on the version of XML being used). Future work by W3C is expected to address ways to specify conformance for documents involving multiple namespaces. Language-specific (i.e. non-SSML) elements may be inserted into SSML using an appropriate namespace. However, such content would only be rendered by a synthesis processor that supported the custom markup. Here is an example of how one might insert Ruby [RUBY] elements into SSML:
<?xml version="1.0" encoding="UTF-8"?>
<speak version="1.1"
xmlns="http://www.w3.org/2001/10/synthesis"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
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="ja">
<!-- It's 20 July today. -->
<s>今日は七月
<xhtml:ruby>
<xhtml:rb>二十日</xhtml:rb>
<xhtml:rt role="alphabet:x-JEITA">ハツカ</xhtml:rt>
</xhtml:ruby>
です。
</s>
<!-- It's 20 July today. -->
<s>今日は七月
<xhtml:ruby>
<xhtml:rb>二十日</xhtml:rb>
<xhtml:rt role="alphabet:x-JEITA">ニジューニチ</xhtml:rt>
</xhtml:ruby>
です。
</s>
</speak>
A Speech Synthesis Markup Language processor is a program that can parse and process Conforming Stand-Alone Speech Synthesis Markup Language documents.
In a Conforming Speech Synthesis Markup Language Processor, the XML parser MUST be able to parse and process all XML constructs defined by XML 1.0 [XML 1.0] and XML 1.1 [XML 1.1] and the corresponding versions of Namespaces in XML (1.0 [XMLNS 1.0] and 1.1 [XMLNS 1.1]). This XML parser is not required to perform validation of an SSML document as per its schema or DTD; this implies that during processing of an SSML document it is OPTIONAL to apply or expand external entity references defined in an external DTD.
A Conforming Speech Synthesis Markup Language Processor MUST correctly understand and apply the semantics of each markup element as described by this document unless excepted within a given section as, for example, when implementing only the Core profile rather than the Extended profile.
A Conforming Speech Synthesis Markup Language Processor MUST meet the following requirements for handling of natural (human) languages:
When a Conforming Speech Synthesis Markup Language Processor encounters elements or attributes, other than xml:lang and xml:base, in a non-synthesis namespace it MAY:
There is, however, no conformance requirement with respect to performance characteristics of the Speech Synthesis Markup Language Processor. For instance, no statement is required regarding the accuracy, speed or other characteristics of speech produced by the processor. No statement is made regarding the size of input that a Speech Synthesis Markup Language Processor must support.
A Conforming User Agent is a Conforming Speech Synthesis Markup Language Processor that is capable of accepting an SSML document as input and producing a spoken output by using the information contained in the markup to render the document as intended by the author. A Conforming User Agent MUST support at least one natural language.
Since the output cannot be guaranteed to be a correct representation of all the markup contained in the input there is no conformance requirement regarding accuracy. A conformance test MAY, however, require some examples of correct synthesis of a reference document to determine conformance.
The Synchronized Multimedia Integration Language (SMIL, pronounced "smile") [SMIL] enables simple authoring of interactive audiovisual presentations. SMIL is typically used for "rich media"/multimedia presentations which integrate streaming audio and video with images, text or any other media type. SMIL is an easy-to-learn HTML-like language, and many SMIL presentations are written using a simple text editor. See the SMIL/SSML integration examples in Appendix F.
Aural Cascading Style Sheets [CSS2 §19] are employed to augment standard visual forms of documents (like HTML) with additional elements that assist in the synthesis of the text into audio. In comparison to SSML, ACSS-generated documents are capable of more complex specifications of the audio sequence, including the designation of 3D location of the audio source. Many of the other ACSS elements overlap SSML functionality, especially in the specification of voice type/quality. SSML may be viewed as a superset of ACSS capabilities, excepting spatial audio.
The Voice Extensible Markup Language [VXML] enables Web-based development and content-delivery for interactive voice response applications (see voice browser ). VoiceXML supports speech synthesis, recording and playback of digitized audio, speech recognition, DTMF input, telephony call control, and form-driven mixed initiative dialogs. VoiceXML 2.0 extends SSML for the markup of text to be synthesized. For an example of the integration between VoiceXML and SSML see Appendix F.
The fetching and caching behavior of SSML documents is defined by the environment in which the synthesis processor operates. In a VoiceXML interpreter context for example, the caching policy is determined by the VoiceXML interpreter.
The following elements and attributes are defined in this specification.
The Speech Synthesis Markup Language is an XML application. The root element is speak.
xml:lang is a REQUIRED attribute specifying the language of the root document.
xml:base is an OPTIONAL attribute specifying the Base URI of the root document.
The version attribute is a REQUIRED attribute that indicates the version of the specification to be used for the document and MUST have the value "1.1".
The trimming attributes are specified in a subsection, below.
Before the speak element is executed, the synthesis processor MUST select a default voice. Note that a language speaking failure (see Section 3.1.13) will occur as soon as the first text is encountered if the language of the text is one that the default voice cannot speak. This assumes that the voice has not been changed before encountering the text, of course.
<?xml version="1.0"?>
<speak version="1.1"
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">
... the body ...
</speak>
The speak element can only contain text to be rendered and the following elements: audio, break, emphasis, lang, lexicon, lookup, mark, meta, metadata, p, phoneme, prosody, say-as, sub, s, token, voice, w.
Trimming attributes define the span of the document to be rendered. Both the start and the end of the span within the speak content can be specified using marks.
The following trimming attributes are defined for speak:
| Name | Required | Type | Default Value | Description |
|---|---|---|---|---|
startmark |
false | TOKEN | none | The mark used to determined when rendering starts. |
endmark |
false | TOKEN | none | The mark used to determine when rendering ends. |
The span of the document rendered is determined as follows:
startmark is specified, then rendering starts at the startmark. If startmark is not specified,
rendering begins at the beginning of the
document. endmark is specified, then rendering ends at the endmark. If the endmark is not specified, rendering ends
at the document end. startmark is after the endmark, then no audio is generated. It is an error if the value given for either startmark or endmark is not a valid mark in the document.
If no trimming attributes are specified, then the complete document is rendered:
<speak version="1.1"
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">
<audio src="first.wav"/>
<mark name="mark1"/>
<audio src="middle.wav"/>
<mark name="mark2"/>
<audio src="last.wav"/>
</speak>
here "first.wav", "middle.wav" and "last.wav" are rendered, where the mark "mark2" is the last mark rendered.
The startmark can be used to specify that rendering begins from a
specific mark:
<speak startmark="mark1" version="1.1"
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">
<audio src="first.wav"/>
<mark name="mark1"/>
<audio src="middle.wav"/>
<mark name="mark2"/>
<audio src="last.wav"/>
</speak>
"middle.wav" and "last.wav" are rendered, but not "first.wav" since it
occurs before the startmark "mark1".
The end of rendering can be specified using the endmark:
<speak endmark="mark2" version="1.1"
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">
<audio src="first.wav"/>
<mark name="mark1"/>
<audio src="middle.wav"/>
<mark name="mark2"/>
<audio src="last.wav"/>
</speak>
where "first.wav" and "middle.wav" are completely rendered but none of "last.wav" is rendered.
Finally, these trimming attributes can be used to control both the start and end of rendering:
<speak startmark="mark1" endmark="mark1"
version="1.1"
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">
<audio src="first.wav"/>
<mark name="mark1"/>
<audio src="middle.wav"/>
<mark name="mark2"/>
<audio src="last.wav"/>
</speak>
where only "middle.wav" is played.
xml:lang AttributeThe xml:lang attribute, as defined by XML [XML 1.0 or XML 1.1, as appropriate, §2.12], MAY be used in SSML to indicate the natural language of the written content of the element on which it occurs. BCP47 [BCP47] can help in understanding how to use this attribute.
Language information is inherited down the document hierarchy, i.e. it needs to be given only once if the whole document is in one language, and language information nests, i.e. inner attributes overwrite outer attributes.
xml:lang is a defined attribute for the speak, lang, desc, p, s, token, and w elements.
xml:lang is permitted on p, s, token, and w only because it is common to change the language at those levels.
The synthesis processor SHOULD use the value of the xml:lang attribute to assist it in determining the best way of rendering the content of the element on which it occurs.
If the document author requires a new voice that is better adapted to the new language, then the synthesis processor can be explicitly requested to select a new voice by using the voice element. Further information about voice selection appears in Section 3.2.1.
The text normalization processing step may be affected by the enclosing language. This is true for both markup support by the say-as element and non-markup behavior. In the following example the same text "2/1/2000" may be read as "February first two thousand" in the first sentence, following American English pronunciation rules, but as "the second of January two thousand" in the second one, which follows Italian preprocessing rules.
<?xml version="1.0" encoding="ISO-8859-1"?>
<speak version="1.1" 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">
<s>Today, 2/1/2000.</s>
<!-- Today, February first two thousand -->
<s xml:lang="it">Un mese fà, 2/1/2000.</s>
<!-- Un mese fà, il due gennaio duemila -->
<!-- One month ago, the second of January two thousand -->
</speak>
xml:base AttributeRelative URIs are resolved according to a base URI, which may come from a variety of sources. The base URI declaration allows authors to specify a document's base URI explicitly. See Section 3.1.3.1 for details on the resolution of relative URIs.
The base URI declaration is permitted but OPTIONAL. The two elements affected by it are
- audio
- The OPTIONAL
srcattribute can specify a relative URI.- lexicon
- The
uriattribute can specify a relative URI.
The base URI declaration follows [XML-BASE] and is indicated by an xml:base attribute on the root speak element.
<?xml version="1.0"?>
<speak version="1.1" xml:lang="en-US"
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:base="http://www.example.com/base-file-path">
<?xml version="1.0"?>
<speak version="1.1" xml:lang="en-US"
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:base="http://www.example.com/another-base-file-path">
User agents MUST calculate the base URI for resolving relative URIs according to [RFC3986]. The following describes how RFC3986 applies to synthesis documents.
User agents MUST calculate the base URI according to the following precedences (highest priority to lowest):
xml:base attribute on the speak element (see Section 3.1.3).xml:id AttributeThe xml:id attribute XML-ID MAY be used in SSML to give an element an identifier that is unique to the document, allowing the element to be referenced from other documents.
xml:id is a defined attribute for the lexicon, p, s, token, and w elements.
An SSML document MAY reference one or more lexicon documents. A lexicon document is located by a URI with an OPTIONAL media type and is assigned a name that is unique in the SSML document.
Any number of lexicon elements MAY occur as immediate children of the speak element.
The lexicon element MUST have a uri attribute specifying a URI that identifies the location of the lexicon document.
The lexicon element MUST have an xml:id attribute that assigns a name to the lexicon document. The name MUST be unique to the current SSML document. The scope of this name is the current SSML document.
The lexicon element MAY have a type attribute that specifies the media type of the lexicon document. The default value of the type attribute is application/pls+xml, the media type associated with Pronunciation Lexicon Specification [PLS] documents as defined in [RFC4267].
The lexicon element is an empty element.
Note: the description and table that follow use an imaginary vendor-specific lexicon type of x-vnd.example.lexicon. This is intended to represent whatever format is returned/available, as appropriate.
A lexicon resource indicated by a URI reference may be available in one or more media types. The SSML author can specify the preferred media type via the type attribute. When the content represented by a URI is available in many data formats, a synthesis processor MAY use the preferred type to influence which of the multiple formats is used. For instance, on a server implementing HTTP content negotiation, the processor may use the type to order the preferences in the negotiation.
Upon delivery, the resource indicated by a URI reference may be considered in terms of two types. The declared media type is the alleged value for the resource and the actual media type is the true format of its content. The actual type should be the same as the declared type, but this is not always the case (e.g. a misconfigured HTTP server might return text/plain for a document following the vendor-specific x-vnd.example.lexicon format). A specific URI scheme may require that the resource owner always, sometimes, or never return a media type. Whenever a type is returned, it is treated as authoritative. The declared media type is determined by the value returned by the resource owner or, if none is returned, by the preferred media type given in the SSML document.
Three special cases may arise. The declared type may not be supported by the processor; this is an error. The declared type may be supported but the actual type may not match; this is also an error. Finally, no media type may be declared; the behavior depends on the specific URI scheme and the capabilities of the synthesis processor. For instance, HTTP 1.1 allows document introspection (see [RFC2616 §7.2.1]), the data scheme falls back to a default media type, and local file access defines no guidelines. The following table provides some informative examples:
|
HTTP 1.1 request |
Local file access |
|||
|---|---|---|---|---|
| Media type returned by the resource owner | text/plain | x-vnd.example.lexicon | <none> | <none> |
| Preferred media type from the SSML document | Not applicable; the returned type is authoritative. | x-vnd.example.lexicon | application/pls+xml | |
| Declared media type | text/plain | x-vnd.example.lexicon | x-vnd.example.lexicon | <none> |
| Behavior for an actual media type of x-vnd.example.lexicon | This MUST be processed as text/plain. This will generate an error if text/plain is not supported or if the document does not follow the expected format. | The declared and actual types match; success if x-vnd.example.lexicon is supported by the synthesis processor; otherwise an error. | Scheme specific; the synthesis processor might introspect the document to determine the type. | |
The lookup element MUST have a ref attribute. The ref attribute specifies a name that references a lexicon document as assigned by the xml:id attribute of the lexicon element.
The referenced lexicon document may contain information (e.g., pronunciation) for tokens that can appear in a text to be rendered. For PLS lexicon documents, the information contained within the PLS document MUST be used by the synthesis processor when rendering tokens that appear within the context of a lookup element. For non-PLS lexicon documents, the information contained within the lexicon document SHOULD be used by the synthesis processor when rendering tokens that appear within the content of a lookup element, although the processor MAY choose not to use the information if it is deemed incompatible with the content of the SSML document. For example, a vendor-specific lexicon may be used only for particular values of the interpret-as attribute of the say-as element, or for a particular set of voices. Vendors SHOULD document the expected behavior of the synthesis processor when SSML content refers to a non-PLS lexicon.
A lookup element MAY contain other lookup elements. When a lookup element contains other lookup elements, the child lookup elements have higher precedence. Precedence means that a token is first looked up in the lexicon with highest precedence. Only if the token is not found in that lexicon is it then looked up in the lexicon with the next lower precedence, and so on until the token is successfully found or until all lexicons have been used for lookup. It is assumed that the synthesis processor already has one or more built-in system lexicons which will be treated as having a lower precedence than those specified using the lexicon and lookup elements.
The lookup element can only contain text to be rendered and the following elements: audio, break, emphasis, lang, lookup, mark, p, phoneme, prosody, say-as, sub, s, token, voice, w.
<?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.1"
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.example.com/lexicon.pls"
xml:id="pls"/>
<lexicon uri="http://www.example.com/strange-words.file"
xml:id="sw"
type="media-type"/>
<lookup ref="pls">
tokens here are looked up in lexicon.pls
<lookup ref="sw">
tokens here are looked up first in strange-words.file and then, if not found, in lexicon.pls
</lookup>
tokens here are looked up in lexicon.pls
</lookup>
tokens here are not looked up in lexicon documents
...
</speak>
The metadata and meta elements are containers in which information about the document can be placed. The metadata element provides more general and powerful treatment of metadata information than meta by using a metadata schema.
A meta declaration associates a string to a declared meta property or declares "http-equiv" content. Either a name or http-equiv attribute is REQUIRED. It is an error to provide both name and http-equiv attributes. A content attribute is REQUIRED. The seeAlso property is the only defined meta property name. It is used to specify a resource that might provide additional metadata information about the content. This property is modelled on the seeAlso property of Resource Description Framework (RDF) Schema Specification 1.0 [RDF-SCHEMA §5.4.1]. The http-equiv attribute has a special significance when documents are retrieved via HTTP. Although the preferred method of providing HTTP header information is by using HTTP header fields, the "http-equiv" content MAY be used in situations where the SSML document author is unable to configure HTTP header fields associated with their document on the origin server, for example, cache control information. Note that HTTP servers and caches are not required to introspect the contents of meta in SSML documents and thereby override the header values they would send otherwise.
Informative: This is an example of how meta elements can be included in an SSML document to specify a resource that provides additional metadata information and also indicate that the document must not be cached.
<?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.1"
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">
<meta name="seeAlso" content="http://example.com/my-ssml-metadata.xml"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
</speak>
The meta element is an empty element.
The metadata element is a container in which information about the document can be placed using a metadata schema. Although any metadata schema can be used with metadata, it is RECOMMENDED that the XML syntax of the Resource Description Framework (RDF) [RDF-XMLSYNTAX] be used in conjunction with the general metadata properties defined in the Dublin Core Metadata Initiative [DC].
The Resource Description Format [RDF] is a declarative language and provides a standard way for using XML to represent metadata in the form of statements about properties and relationships of items on the Web. Content creators should refer to W3C metadata Recommendations [RDF-XMLSYNTAX] and [RDF-SCHEMA] when deciding which metadata RDF schema to use in their documents. Content creators should also refer to the Dublin Core Metadata Initiative [DC], which is a set of generally applicable core metadata properties (e.g., Title, Creator, Subject, Description, Rights, etc.).
Document properties declared with the metadata element can use any metadata schema.
Informative: This is an example of how metadata can be included in an SSML document using the Dublin Core version 1.0 RDF schema [DC] describing general document information such as title, description, date, and so on:
<?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.1
"
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">
<metadata>
<rdf:RDF
xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs = "http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc = "http://purl.org/dc/elements/1.1/">
<!-- Metadata about the synthesis document -->
<rdf:Description rdf:about="http://www.example.com/meta.ssml"
dc:Title="Hamlet-like Soliloquy"
dc:Description="Aldine's Soliloquy in the style of Hamlet"
dc:Publisher="W3C"
dc:Language="en-US"
dc:Date="2002-11-29"
dc:Rights="Copyright 2002 Aldine Turnbet"
dc:Format="application/ssml+xml" >
<dc:Creator>
<rdf:Seq ID="CreatorsAlphabeticalBySurname">
<rdf:li>William Shakespeare</rdf:li>
<rdf:li>Aldine Turnbet</rdf:li>
</rdf:Seq>
</dc:Creator>
</rdf:Description>
</rdf:RDF>
</metadata>
</speak>
The metadata element can have arbitrary content, although none of the content will be rendered by the synthesis processor.
A p element represents a paragraph. An s element represents a sentence.
xml:lang and xml:id are defined attributes on the p and s elements.
<?xml version="1.0"?>
<speak version="1.1" 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">
<p>
<s>This is the first sentence of the paragraph.</s>
<s>Here's another sentence.</s>
</p>
</speak>
The use of p and s elements is OPTIONAL. Where text occurs without an enclosing p or s element the synthesis processor SHOULD attempt to determine the structure using language-specific knowledge of the format of plain text.
The p element can only contain text to be rendered and the following elements: audio, break, emphasis, lang, mark, phoneme, prosody, say-as, sub, s, token, voice, w.
The s element can only contain text to be rendered and the following elements: audio, break, emphasis, lang, mark, phoneme, prosody, say-as, sub, token, voice, w.
The token element allows the author to indicate its content is a token and to eliminate token (word) segmentation ambiguities of the synthesis processor.
The token element is necessary in order to render languages
Use of this element can result in improved cues for prosodic control (e.g., pause) and may assist the synthesis processor in selection of the correct pronunciation for homographs. Other elements such as break, mark, and prosody are permitted within token to allow annotation at a sub-token level (e.g., syllable, mora, or whatever units are reasonable for the current language). Synthesis processors are REQUIRED to parse these annotations and MAY render them as they are able.
The text contents of the token element and its subelements are together considered to be one token for lexical lookup purposes as follows:
Thus, "<token><emphasis>hap</emphasis>py</token>" and "<token><emphasis> hap </emphasis> py</token>" would refer to the tokens "happy" and "hap py", respectively. Note that this is different from how text and markup outside a token element are treated (see "Text normalization" in Section 1.2).
The use of token elements is OPTIONAL. Where text occurs without an enclosing token element the synthesis processor SHOULD attempt to determine the token segmentation using language-specific knowledge of the format of plain text.
xml:lang is a defined attribute on the token element to identify the written language of the content.
xml:id is a defined attribute on the token element.
role is an OPTIONAL defined attribute on the token element. The role attribute takes as its value one or more white-space separated QNames (as defined in Section 4 of Namespaces in XML (1.0 [XMLNS 1.0] or 1.1 [XMLNS 1.1], depending on the version of XML being used)). A QName
in the attribute content is expanded into an expanded-name
using the namespace declarations in scope for the containing token element.
Thus, each QName provides a reference to a specific item in the
designated namespace. In the second example below, the QName within the
role attribute expands to the "VV0" item in the
"http://www.example.com/claws7tags" namespace.
This mechanism allows for referencing defined taxonomies of word
classes, with the expectation that they are documented at the
specified namespace URI.
The role attribute is intended to be of use in synchronizing with other specifications, for example to describe additional information to help the selection of the most appropriate pronunciation for the contained text inside an external lexicon (see lexicon documents).
The token element can only contain text to be rendered and the following elements: audio, break, emphasis, mark, phoneme, prosody, say-as, sub, voice.
The token element can only be contained in the following elements: audio, emphasis, lang, lookup, prosody, speak, p, s, voice.
The w element is an alias for the token element.
Here is an example showing the use of the token element.
<?xml version="1.0"?>
<speak version="1.1" 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="zh-CN">
<!-- The Nanjing Changjiang River Bridge -->
<w>南京市</w><w>长江大桥</w>
<!-- The mayor of Nanjin city, Jiang Daqiao -->
南京市长<w>江大桥</w>
<!-- Shanghai is a metropoli -->
上海是个<w>大都会</w>
<!-- Most Shanghainese will say something like that -->
上海人<w>大都</w>会那么说
</speak>
The next example shows the use of the role attribute. The first document below is a sample lexicon (PLS) for the Chinese word "处". The second references this lexicon and shows how the role attribute may be used to select the appropriate pronunciation of the Chinese word "处" in the dialog.
<?xml version="1.0" encoding="UTF-8"?>
<lexicon version="1.0"
xmlns="http://www.w3.org/2005/01/pronunciation-lexicon"
xmlns:claws="http://www.example.com/claws7tags"
alphabet="x-myorganization-pinyin"
xml:lang="zh-CN">
<lexeme role="claws:VV0">
<!-- base form of lexical verb -->
<grapheme>处</grapheme>
<phoneme>chu3</phoneme>
<!-- pinyin string is: "chǔ" in 处罚 处置 -->
</lexeme>
<lexeme role="claws:NN">
<!-- common noun, neutral for number -->
<grapheme>处</grapheme>
<phoneme>chu4</phoneme>
<!-- pinyin string is: "chù" in 处所 妙处 -->
</lexeme>
</lexicon>
<?xml version="1.0" encoding="UTF-8"?>
<speak version="1.1" 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"
xmlns:claws="http://www.example.com/claws7tags"
xml:lang="zh-CN">
<lexicon uri="http://www.example.com/lexicon.pls"
type="application/pls+xml"
xml:id="mylex"/>
<lookup ref="mylex">
他这个人很不好相<w role="claws:VV0">处</w>。
此<w role="claws:NN">处</w>不准照相。
</lookup>
</speak>
The say-as element allows the author to indicate information on the type of text construct contained within the element and to help specify the level of detail for rendering the contained text.
Defining a comprehensive set of text format types is difficult because of the variety of languages that have to be considered and because of the innate flexibility of written languages. SSML only specifies the say-as element, its attributes, and their purpose. It does not enumerate the possible values for the attributes. The Working Group expects to produce a separate document that will define standard values and associated normative behavior for these values. Examples given here are only for illustrating the purpose of the element and the attributes.
The say-as element has three attributes: interpret-as, format, and detail. The interpret-as attribute is always REQUIRED; the other two attributes are OPTIONAL. The legal values for the format attribute depend on the value of the interpret-as attribute.
The say-as element can only contain text to be rendered.
interpret-as and format attributesThe interpret-as attribute indicates the content type of the contained text construct. Specifying the content type helps the synthesis processor to distinguish and interpret text constructs that may be rendered in different ways depending on what type of information is intended. In addition, the OPTIONAL format attribute can give further hints on the precise formatting of the contained text for content types that may have ambiguous formats.
When specified, the interpret-as and format values are to be interpreted by the synthesis processor as hints provided by the markup document author to aid text normalization and pronunciation.
In all cases, the text enclosed by any say-as element is intended to be a standard, orthographic form of the language currently in context. A synthesis processor SHOULD be able to support the common, orthographic forms of the specified language for every content type that it supports.
When the value for the interpret-as attribute is unknown or unsupported by a processor, it MUST render the contained text as if no interpret-as value were specified.
When the value for the format attribute is unknown or unsupported by a processor, it MUST render the contained text as if no format value were specified, and SHOULD render it using the interpret-as value that is specified.
When the content of the say-as element contains additional text next to the content that is in the indicated format and interpret-as type, then this additional text MUST be rendered. The processor MAY make the rendering of the additional text dependent on the interpret-as type of the element in which it appears.
When the content of the say-as element contains no content in the indicated interpret-as type or format, the processor MUST render the content either as if the format attribute were not present, or as if the interpret-as attribute were not present, or as if neither the format nor interpret-as attributes were present. The processor SHOULD also notify the environment of the mismatch.
Indicating the content type or format does not necessarily affect the way the information is pronounced. A synthesis processor SHOULD pronounce the contained text in a manner in which such content is normally produced for the language.
detail attributeThe detail attribute is an OPTIONAL attribute that indicates the level of detail to be read aloud or rendered. Every value of the detail attribute MUST render all of the informational content in the contained text; however, specific values for the detail attribute can be used to render content that is not usually informational in running text but may be important to render for specific purposes. For example, a synthesis processor will usually render punctuation through appropriate changes in prosody. Setting a higher level of detail may be used to speak punctuation explicitly, e.g. for reading out coded part numbers or pieces of software code.
The detail attribute can be used for all interpret-as types.
If the detail attribute is not specified, the level of detail that is produced by the synthesis processor depends on the text content and the language.
When the value for the detail attribute is unknown or unsupported by a processor, it MUST render the contained text as if no value were specified for the detail attribute.
The phoneme element provides a phonemic/phonetic pronunciation for the contained text. The phoneme element MAY be empty. However, it is RECOMMENDED that the element contain human-readable text that can be used for non-spoken rendering of the document. For example, the content may be displayed visually for users with hearing impairments.
The ph attribute is a REQUIRED attribute that specifies the phoneme/phone string.
This element is designed strictly for phonemic and phonetic notations and is intended to be used to provide pronunciations for words or very short phrases. The phonemic/phonetic string does not undergo text normalization and is not treated as a token for lookup in the lexicon (see Section 3.1.5), while values in say-as and sub may undergo both. Briefly, phonemic strings consist of phonemes, language-dependent speech units that characterize linguistically significant differences in the language; loosely, phonemes represent all the sounds needed to distinguish one word from another in a given language. On the other hand, phonetic strings consist of phones, speech units that characterize the manner (puff of air, click, vocalized, etc.) and place (front, middle, back, etc.) of articulation within the human vocal tract and are thus independent of language; phones represent realized distinctions in human speech production.
The alphabet attribute is an OPTIONAL attribute that specifies the phonemic/phonetic pronunciation scheme. A pronunciation scheme in this context refers to a collection of symbols to represent the sounds of one or more human languages. The only valid values for this attribute are "ipa" (see the next paragraph), values defined in the Pronunciation Scheme Registry and vendor-defined strings of the form "x-organization" or "x-organization-scheme". For example, the Japan Electronics and Information Technology Industries Association [JEITA] might wish to encourage the use of an scheme such as "x-JEITA" or "x-JEITA-2000" for their phoneme alphabet [JEIDAALPHABET].
Synthesis processors SHOULD support a value for alphabet of "ipa", corresponding to Unicode representations of the phonetic characters developed by the International Phonetic Association [IPA]. In addition to an exhaustive set of vowel and consonant symbols, this character set supports a syllable delimiter, numerous diacritics, stress symbols, lexical tone symbols, intonational markers and more. For this scheme, legal ph values are strings of the values specified in Appendix 2 of [IPAHNDBK]. Informative tables of the IPA-to-Unicode mappings can be found at [IPAUNICODE1] and [IPAUNICODE2]. Note that not all of the IPA characters are available in Unicode. For processors supporting this alphabet,
ph values.
<?xml version="1.0"?>
<speak version="1.1" 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">
<phoneme alphabet="ipa" ph="təmei̥ɾou̥"> tomato </phoneme>
<!-- This is an example of IPA using character entities -->
<!-- Because many platform/browser/text editor combinations do not
correctly cut and paste Unicode text, this example uses the entity
escape versions of the IPA characters. Normally, one would directly
use the UTF-8 representation of these symbols: "təmei̥ɾou̥". -->
</speak>
It is an error if a value for alphabet is specified that is not known or cannot be applied by a synthesis processor. The default behavior when the alphabet attribute is left unspecified is processor-specific.
The type attribute is an optional attribute that indicates additional information about how the pronunciation information is to be interpreted. The only allowed value for this attribute is "ruby", which indicates that the pronunciation information is from Ruby [RUBY].
Issue: There is discussion about renaming the "alphabet" attribute to be the "scheme" attribute since we have replaced the word "Alphabet" with "Scheme" in the rest of this section. However, there is concern that the change would be too drastic, as well as unnecessary, for this version of SSML.
The phoneme element itself can only contain text (no elements).
The Pronunciation Scheme Registry will be maintained by W3C.
Issue: We are still working out the location and details of the Registry. A link will be provided in this document when it is available.
The sub element is employed to indicate that the text in the alias attribute value replaces the contained text for pronunciation. This allows a document to contain both a spoken and written form. The REQUIRED alias attribute specifies the string to be spoken instead of the enclosed string. The processor SHOULD apply text normalization to the alias value.
The sub element can only contain text (no elements).
<?xml version="1.0"?>
<speak version="1.1" 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">
<sub alias="World Wide Web Consortium">W3C</sub>
<!-- World Wide Web Consortium -->
</speak>
The lang element is used to specify the natural language of the content.
The lang element has one attribute, xml:lang, which is always REQUIRED.
This element MAY be used when there is a change in the natural language. There is no text structure associated with the language change indicated by the lang element. It MAY be used to specify the language of the content at a level other than a paragraph, sentence or word level. When language change is to be associated with text structure, it is RECOMMENDED to use the xml:lang attribute on the respective p, s, token, or w element.
<?xml version="1.0"?>
<speak version="1.1" 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">
The French