Share via


say-as Element

The say-as element indicates the content type (such as number or date) of text contained in the element. This provides guidance to the speech synthesis engine about how to pronounce the contained text.

Syntax

<say-as interpret-as="string" format=”digit string” detail=”string”> <say-as>

Attributes

Attribute

Description

interpret-as

Required. Indicates the content type of text contained in the element. The SSML 1.0 say-as attribute values specification defines six content types.

format

Optional. Provides additional information about the precise formatting of the contained text for content types that may have ambiguous formats. SSML defines formats for content types that use them.

detail

Optional. Indicates the level of detail to be spoken. For example, this attribute might request that the speech synthesis engine pronounce punctuation marks.

There are no standard values defined for the detail attribute. Support for this attribute depends on the individual speech synthesis engine.

The following table lists the supported content types for the interpret-as attribute, and the supported values for the format attribute, where applicable.

Interpret-as

Format

Interpretation

date

dmy, mdy, ymd, ym, my, md, dm, d, m, y

The contained text is a date in the specified format. In the format designations, d=day, m=month, and y=year. The format for date indicates which date components are represented and their sequence. The following is an example of a say-as element that contains a date:

Today is <say-as interpret-as="date" format="mdy">10-19-2003</say-as>

The speech synthesizer should pronounce “Today is October nineteenth two thousand three”.

cardinal

-

The contained text should be spoken as a cardinal number. The following is an example of a say-as element that contains a cardinal number:

There are <say-as interpret-as=”cardinal”>3</say-as> alternatives.

The speech synthesizer should pronounce “There are three alternatives”.

ordinal

-

The contained text should be interpreted as an ordinal number. The following is an example of a say-as element that contains an ordinal number:

Select the <say-as interpret-as=”ordinal”>3rd</say-as> option.

The speech synthesizer should pronounce “Select the third option”.

characters

-

Indicates that each letter in the contained text should be pronounced individually (spelled out). The following is an example of a say-as element that contains a word that should be spoken as individual letters:

<say-as interpret-as="characters">test</say-as>.

The speech synthesizer should pronounce each letter: “T E S T”.

time

hms12, hms24

The contained text is a time. Time may be expressed using either a 12-hour clock (hms12) or a 24-hour clock (hms24).The format attribute indicates which clock to use. The following is an example of a say-as element that contains a time:

The train departs at <say-as interpret-as="time" format=”hms12”>4:00am</say-as>.

The speech synthesizer should speak “The train departs at four A M”.

Use a colon to separate numbers representing hours, minutes, and seconds. The following time strings are all valid examples: 12:35, 1:14:32, 08:15, and 02:50:45.

telephone

digit string

The contained text is a telephone number. The format attribute may contain digits that represent a country code, for example “1” for the United States or “39” for Italy. The speech synthesis engine may use this information to guide its pronunciation of a phone number. The country code may also be included in the phone number, and if so, takes precedence over the country code in the format attribute if there is a mismatch. The following is an example of a say-as element that contains a telephone number:

The number is <say-as interpret-as="telephone" format=”1”>(888) 555-1212</say-as>.

The speech synthesizer should speak “My number is area code eight eight eight five five five one two one two”.

Example

The speech synthesis engine should speak the following example as “Your first request was for one room on October nineteenth twenty ten with early arrival at twelve thirty five P M”.

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

  <p>
  Your <say-as interpret-as="ordinal"> 1st </say-as> request
was for <say-as interpret-as="cardinal"> 1 </say-as> room
on <say-as interpret-as="date" format="mdy"> 10/19/2010 </say-as>,
with early arrival at <say-as interpret-as="time" format="hms12"> 12:35pm </say-as>.
  </p>

</speak>

For more information, see the SSML 1.0 say-as attribute values and the Speech Synthesis Markup Language (SSML) Version 1.0