Speech Synthesis Markup Language

Updated at:

This topic describes Speech Synthesis Markup Language (SSML), supported tags, and usage examples for CosyVoice models.

Overview

SSML is an XML-based speech synthesis markup language. Unlike plain text, SSML provides richer and more varied audio output. It controls not only what is spoken but also how it is spoken, letting you customize attributes such as text segmentation, pronunciation, rate, breaks, pitch, volume, and even background music.

Note

Alibaba Cloud Speech Synthesis Service implements SSML based on the W3C Speech Synthesis Markup Language Version 1.0. However, it supports a subset of W3C tag types chosen for common business applications.

Important

CosyVoice supports SSML only for long-text synthesis, not for streaming text input (bidirectional streaming).

Usage

Note
  • Enclose all text in <speak></speak> tags. A standard speech synthesis task can contain only one <speak> element. However, long-text tasks, including real-time long-text synthesis and asynchronous long-text synthesis, can contain multiple <speak> elements.

  • A long-text speech synthesis request can use multiple <speak></speak> tags and combine SSML with plain text. The content in the following example can be submitted as a single request to the long-text speech synthesis service.

    <speak><say-as interpret-as="telephone">114</say-as> for number lookup. <say-as interpret-as="cardinal">123</say-as> to get started. The sum is <say-as interpret-as="digits">1234</say-as>. <say-as interpret-as="name">Zhang San</say-as>'s package. <say-as interpret-as="address">Room 304, Unit 3, Building 1, Fulu International</say-as><say-as interpret-as="nick">Li Si 6689</say-as></speak>
  • You can omit the XML header before the leading <speak> tag.

  • Escape any special XML characters within your tags. Here are the common special characters and their corresponding entities:

    • Replace " (double quote) with &quot;

    • Replace ' (apostrophe or single quote) with &apos;

    • Replace & (ampersand) with &amp;

    • Replace < (less-than sign) with &lt;

    • Replace > (greater-than sign) with &gt;

Pass the marked-up text as the value of the text parameter to the speech synthesis service, as shown in the following Java SDK example:

String text = "<speak>Please close your eyes and rest for a moment<break time=\"500ms\"/>Okay, please open your eyes.</speak>";
synthesizer.startTts(text, 1000);
synthesizer.waitForComplete();

Tags

<speak>: The root element

  • Description

    All text using SSML tags must be enclosed in <speak></speak> tags.

  • Syntax

     <speak>Text to be processed with SSML tags</speak>
  • Attributes

    The <speak> tag supports the following attributes.

    Parameter

    Type

    Value

    Required

    Description

    voice

    String

    The name of a public voice, specified as a lowercase string. For example, "siyue".

    No

    An Alibaba Cloud-specific attribute that sets the synthesis voice. It overrides the voice API request parameter.

    Important

    When you use Model Studio, specify the voice with the voice parameter. Available voices depend on the selected model. For more information, see the CosyVoice voice list.

    Important

    The "xiaoyue" voice is not currently supported in the voice attribute.

    rate

    String

    An integer in the range of [-500, 500]. The default value is 0.

    • A value greater than 0 increases the speech rate.

    • A value less than 0 decreases the speech rate.

    No

    An Alibaba Cloud-specific attribute that sets the speech rate. It overrides the speech_rate API request parameter.

    Important

    When using Model Studio, the valid range for this parameter is [0.5, 2], which corresponds to the actual speed multiplier. The default value is 1, which represents the normal speech rate.

    pitch

    String

    An integer in the range of [-500, 500]. The default value is 0.

    • A value greater than 0 increases the pitch.

    • A value less than 0 decreases the pitch.

    No

    An Alibaba Cloud-specific attribute that sets the audio pitch. It overrides the pitch_rate API request parameter.

    Important

    When using Model Studio, the valid range for this parameter is [0.5, 2], which corresponds to the actual pitch multiplier. The default value is 1, which represents the normal pitch.

    volume

    String

    An integer in the range of [0, 100]. The default value is 50.

    • A value greater than 50 increases the volume.

    • A value less than 50 decreases the volume.

    No

    An Alibaba Cloud-specific attribute that sets the audio volume. It overrides the volume API request parameter.

    effect

    String

    robot, lolita, lowpass, echo, eq, lpfilter, or hpfilter

    No

    An Alibaba Cloud-specific attribute that applies a sound effect to the synthesized speech.

    • robot: Robot sound effect.

    • lolita: Lolita sound effect.

    • lowpass: Low-pass sound effect.

    • echo: Echo sound effect.

    • eq: Equalizer.

    • lpfilter: Low-pass filter.

    • hpfilter: High-pass filter.

    Note

    • eq, lpfilter, and hpfilter are advanced effectors. You can use the effectValue attribute to customize their settings.

    • Each SSML document supports only one sound effect. You cannot specify multiple effect attributes.

    • Using sound effects increases system latency.

    effectValue

    String

    Overrides the default effector settings when effect is set to eq, lpfilter, or hpfilter.

    No

    • eq (equalizer): The system uses eight bands by default. The corresponding frequencies are "40 Hz", "100 Hz", "200 Hz", "400 Hz", "800 Hz", "1600 Hz", "4000 Hz", and "12000 Hz". The corresponding bandwidths are "1.0q", "1.0q", "1.0q", "1.0q", "1.0q", "1.0q", "1.0q", and "1.0q". You must provide the gain for each of the eight bands. The valid gain range for each band is [-20 dB, 20 dB]. The value is a string of eight space-separated integers. A value of 0 means no gain adjustment for the corresponding frequency. For example, effectValue="1 1 1 1 1 1 1 1".

    • lpfilter: Specifies the cutoff frequency for the low-pass filter. The value must be an integer in the range of (0, target sample rate / 2]. For example, effectValue="800".

    • hpfilter: Specifies the cutoff frequency for the high-pass filter. The value must be an integer in the range of (0, target sample rate / 2]. For example, effectValue="1200".

    bgm

    String

    The URL of an online background music file. For more information, see the bgm attribute description.

    No

    An Alibaba Cloud-specific attribute that adds background music to the synthesized speech.

    backgroundMusicVolume

    String

    An integer in the range of [0, 100]. The default value is 50.

    • A value greater than 50 increases the volume.

    • A value less than 50 decreases the volume.

    No

    An Alibaba Cloud-specific attribute that controls the background music volume.

    The following table describes the bgm attribute.

    Built-in URL

    Custom URL

    The Alibaba Cloud speech synthesis service provides the following built-in background music tracks:

    To use custom background music, store the audio file in an OSS bucket with at least public-read permission. To create a bucket, see Create a bucket. To upload the audio file and obtain an HTTP or HTTPS URL, see Upload objects.

    Audio requirements:

    • WAV format, 16 kHz sample rate, mono.

    • Size limit: 2.8 MB for short text speech synthesis, 7.3 MB for long text speech synthesis.

    • If the synthesized audio is longer than the background music, the background music loops. If your background music is not in WAV format, you can convert it using FFmpeg: ffmpeg -i input_audio -acodec pcm_s16le -ac 1 -ar 16000 target.wav.

    • If the URL in the tag contains special XML characters, escape them.

    • Bit depth: 16-bit.

    Important

    You are responsible for ensuring the copyright compliance of the audio you upload.

  • Tag relationships

    The <speak> tag can contain text and the following tags:

    • <break>

    • <phoneme>

    • <say-as>

  • Examples

    • No attributes

      <speak>
        Text to be processed with SSML tags
      </speak>
    • voice attribute

      <speak voice="longcheng_v2">
        I am a male voice.
      </speak>
    • rate attribute

      <speak rate="200">
        My speech rate is faster than normal.
      </speak>
    • pitch attribute

      <speak pitch="-100">
        But my pitch is lower than normal.
      </speak>
    • volume attribute

      <speak volume="80">
        My volume is also loud.
      </speak>
    • Combining attributes

      <speak rate="200" pitch="-100" volume="80">
        So, all together, this is what I sound like.
      </speak>
    • effect attribute

      <speak effect="robot">
        Do you like the robot WALL-E?
      </speak>
    • bgm attribute

      <speak bgm="http://nls.alicdn.com/bgm/2.wav" backgroundMusicVolume="30" rate="-500" volume="40">
        <break time="2s"/>
        Dark cliffs, old trees, vast mist.
        <break time="700ms"/>
        The sound of rain lingers in the bamboo forest.
        <break time="700ms"/>
        Cotton is known to benefit the state.
        <break time="700ms"/>
        The scenery of Mianzhou is always cherished.
        <break time="2s"/>
      </speak>

<break>: Control pause duration

  • Description

    This optional tag inserts a pause into the synthesized speech.

  • Syntax

     # Without attributes
     <break/>
     # With the time attribute
     <break time="string"/>
  • Attributes

    Note

    If you use the <break> tag without attributes, the pause duration defaults to 1s.

    Parameter

    Type

    Value

    Required

    Description

    time

    string

    [number]s/[number]ms

    No

    Sets the pause duration in seconds or milliseconds (e.g., "2s", "50ms").

    • [number]s: Specifies the duration in seconds. [number] must be an integer from 1 to 10.

    • [number]ms: Specifies the duration in milliseconds. [number] must be an integer from 50 to 10,000.

    Important

    When multiple <break> tags are used consecutively, their pause durations are cumulative. The total duration is capped at 10 seconds.

    For example, the three consecutive <break> tags below create a total pause of 15 seconds. Since this exceeds the 10-second limit, the effective pause is 10 seconds.

     <speak>
       Please close your eyes and take a short break.<break time="5s"/><break time="5s"/><break time="5s"/>All right, please open your eyes.
     </speak>
  • Tag relationship

    The <break> tag is an empty tag and cannot contain other tags.

  • Example

     <speak>
       Please close your eyes and take a short break.<break time="500ms"/>All right, please open your eyes.
     </speak>

<sub>: Substitute text

  • Description

    Replaces the text within the tag with a specified alias.

  • Syntax

     <sub alias="string"></sub>
  • Attributes

    Parameter

    Type

    Value

    Required

    Description

    alias

    String

    The substitute text.

    Yes

    The text to speak instead of the tag's content.

  • Tag relationships

    The <sub> tag can only contain text.

  • Example

     <speak><sub alias="network protocol standard">W3C</sub></speak>

<phoneme>: Pronunciation

  • Description

    Specifies the pronunciation of the enclosed text. This is an optional tag.

  • Syntax

     <phoneme alphabet="string" ph="string">text</phoneme>
  • Attributes

    Parameter

    Type

    Value

    Required

    Description

    alphabet

    string

    py/cmu

    Yes

    Specifies the phonetic alphabet. Use py for pinyin or cmu for the CMU Pronouncing Dictionary.

    ph

    string

    The corresponding pinyin or CMU string for the enclosed text.

    Yes

    Pinyin format:

    • Separate the pinyin for each character with a space. The number of pinyin entries must match the number of characters.

    • Each pinyin entry consists of the phonetic spelling and a tone number from 1 to 5, where 5 indicates the neutral tone.

  • Tag relationships

    The <phoneme> tag can only contain text.

  • Examples

     <speak>
        去<phoneme alphabet="py" ph="dian3 dang4 hang2">典当行</phoneme>把这个玩意<phoneme alphabet="py" ph="dang4 diao4">当掉</phoneme>
     </speak>
    <speak>
        How to spell <phoneme alphabet="cmu" ph="S AY N">sin</phoneme>?
    </speak>

<soundEvent>: Insert external audio

  • Description

    A tag that inserts a prompt tone at any point in the SSML synthesis process.

  • Syntax

     <soundEvent src="URL"/>
  • Attributes

    Parameter

    Type

    Value

    Required

    Description

    src

    String

    The URL of the prompt tone resource.

    Yes

    To use a custom sound effect, store the audio file in an OSS bucket with at least public-read permission. To create a bucket, see Create a bucket. To upload the audio file and obtain an HTTP or HTTPS URL, see Upload objects.

    Audio requirements:

    • Format: 16 kHz, single-channel WAV.

    • Maximum size: 2 MB.

    • Bit depth: 16-bit.

    Important

    Ensure you have the necessary rights for any audio you upload.

  • Tag relationships

    The <soundEvent> tag is an empty tag.

  • Example

     <speak>
       A horse was startled<soundEvent src="http://nls.alicdn.com/sound-event/horse-neigh.wav"/>and people scattered to get away.
     </speak>

<say-as>: Specify text interpretation (number, date, phone number, etc.)

  • description

    Specifies the information type of the text within the tag, which determines the default pronunciation style for that type.

  • Syntax

     <say-as interpret-as="string">text</say-as>
  • Attributes

    Parameter

    Type

    Value

    Required

    Description

    interpret-as

    String

    cardinal/digits/telephone/name/address/id/characters/punctuation/date/time/currency/measure

    Yes

    Specifies how to interpret the text within the tag:

    • cardinal: Reads the text as an integer or a decimal.

    • digits: Reads the text digit by digit.

    • telephone: Reads the text as a telephone number.

    • name: Reads the text as a name.

    • address: Reads the text as an address.

    • id: For account names, nicknames, and other identifiers.

    • characters: Spells out the text character by character.

    • punctuation: Spells out the names of punctuation characters.

    • date: Reads the text as a date.

    • time: Reads the text as a time.

    • currency: Reads the text as a monetary value.

    • measure: Reads the text as a measurement.

  • Support for <say-as> types

    • Cardinal

      Format

      Example

      Chinese output

      Description

      digit string

      145

      一百四十五

      Integer input range: Positive and negative integers up to 20 digits, within the range [-99999999999999999999, 99999999999999999999].

      Decimal input: No specific limit on decimal places, but a maximum of 10 is recommended.

      minus sign + digit string

      -145

      负一百四十五

      comma-separated digit string

      10,000

      一万

      minus sign + comma-separated digit string

      -10,124

      负一万零一百二十四

      digit string + decimal point + two zeros

      10.00

      minus sign + digit string + decimal point + two zeros

      -110.00

      负一百一十

      digit string + decimal point + digit string

      79.090

      七十九点零九零

      minus sign + digit string + decimal point + digit string

      -79.001

      负七十九点零零一

      Format

      Example

      English output

      Description

      digit string

      145

      one hundred forty-five

      Integer input range: Positive and negative integers up to 12 digits, within the range [-999999999999, 999999999999].

      Decimal input: No specific limit on decimal places, but a maximum of 10 is recommended.

      digit string with leading zeros

      0145

      one hundred forty-five

      minus sign + digit string

      -145

      minus one hundred forty-five

      comma-separated digit string

      60,000

      sixty thousand

      minus sign + comma-separated digit string

      -208,000

      minus two hundred eight thousand

      digit string + decimal point + zeros

      12.00

      twelve

      digit string + decimal point + digit string

      12.34

      twelve point three four

      comma-separated digit string + decimal point + digit string

      1,000.1

      one thousand point one

      minus sign + digit string + decimal point + digit string

      -12.34

      minus twelve point three four

      minus sign + comma-separated digit string + decimal point + digit string

      -1,000.1

      minus one thousand point one

      Numeric range separated by a hyphen

      1-1,000

      one to one thousand

      Other default readings

      012.34

      twelve point three four

      None

      1/2

      one half

      -3/4

      minus three quarters

      5.1/6

      five point one over six

      -3 1/2

      minus three and a half

      1,000.3^3

      one thousand point three to the power of three

      3e9.1

      three times ten to the power of nine point one

      23.10%

      twenty-three point one zero percent

    • Digits

      Format

      Example

      Chinese output

      Description

      digit string

      129090909

      129090909

      Digit strings have no length limit, but we recommend a maximum of 20 digits.

      If the digit string exceeds 10 digits, the system inserts a pause after each digit.

      Format

      Example

      English output

      Description

      digit string

      12034

      one two zero three four

      Digit strings have no length limit, but we recommend a maximum of 20 digits.

      When a digit string is grouped using spaces or hyphens, the system inserts commas between the groups to create natural pauses. The system supports a maximum of five groups.

      A series of digit groups separated by spaces or hyphens.

      1-23-456 7890

      one, two three, four five six, seven eight nine zero

    • Telephone

      Format

      Example

      Chinese output

      Description

      Landline number

      4930286

      493 0286

      Supports 7- and 8-digit landline numbers. You can use spaces and hyphens (-) as separators.

      The grouping pattern is 3-4 for 7-digit numbers and 4-4 for 8-digit numbers.

      493 0286

      493 0286

      493-0286

      493 0286

      62552560

      6255 2560

      6255 2560

      6255 2560

      6255-2560

      6255 2560

      Landline number + extension number

      4930286-109

      493 0286 ext 109

      Supports 1- to 4-digit extension numbers.

      4930286ext109

      493 0286 ext 109

      4930286ext109

      493 0286 ext 109

      4930286ext109

      493 0286 ext 109

      Area code + landline number

      01062552560

      010 6255 2560

      Supports area codes such as 010, 02x, 03xx, 04xx, 05xx, 07xx, 08xx, and 09xx.

      010 62552560

      010 6255 2560

      010 6255 2560

      010 6255 2560

      010 6255-2560

      010 6255 2560

      010-62552560

      010 6255 2560

      010-6255-2560

      010 6255 2560

      (010)62552560

      010 6255 2560

      03198907098

      0319 890 7098

      0319-8907098

      319 890 7098

      Area code + landline number + extension number

      010 62552560-109

      010 6255 2560 ext. 109

      No additional notes.

      010-62552560-109

      010 6255 2560 ext. 109

      (010)62552560-109

      010 6255 2560 ext. 109

      (010)62552560 ext. 109

      010 6255 2560 ext. 109

      (010)62552560 ext. 109

      010 6255 2560 ext. 109

      (010)62552560 ext. 109

      zero one zero six two five five two five six zero ext. one zero nine

      Country code + area code + landline number

      86-010-62791627

      eight six zero one zero six two seven nine one six two seven

      Supports the country code for China (86) in formats such as (86), +86, (+86), and 0086. All these formats are read aloud as "eight six".

      (86)10-62791627

      eight six one zero six two seven nine one six two seven

      +86-010-62791627

      eight six zero one zero six two seven nine one six two seven

      0086-10-62791627

      86 10 6279 1627

      (+86)-10-6279 1627

      86 10 6279 1627

      Country code + area code + landline number + extension number

      (86)21-58118818-207

      86 21 5811 8818 ext.207

      No additional notes.

      (86)021-5811-8818-207

      86 021 5811 8818 ext.207

      (86)021-58118818ext.207

      86 021 5811 8818 ext.207

      (86)21-5811-8818 ext. 207

      86 21 5811 8818 ext. 207

      +86-021-58118818 ext. 207

      86 021 5811 8818 ext. 207

      Mobile number

      139 0000 5678

      139 0000 5678

      Supports 11-digit mobile numbers with either a 3-3-5 or 3-4-4 grouping pattern.

      139-000-05678

      139 000 05678

      139 000 05678

      139 000 05678

      Country code + mobile number

      +86-13900005678

      86 139 0000 5678

      No additional notes.

      (+86)-139-0000-5678

      86 139 0000 5678

      +8613900005678

      86 139 0000 5678

      0086-139 000 05678

      86 139 000 05678

      Service number

      123

      123

      • Supports common service numbers.

      • Supports 10-digit service numbers that start with 400 or 800, using a 3-3-4 grouping pattern.

      • Supports 16-digit numbers starting with 12530, 17951, or 12593.

      95678

      95678

      4008110510

      400 811 0510

      800-810-8888

      800 810 8888

      1253013520638377

      12530 135 2063 8377

      Other

      (86)(21)9899-80800-0909

      86 21 9899 80800 0909

      Supports combinations of digit strings with separators, such as parentheses and hyphens (-).

      Format

      Example

      English output

      Description

      Digit string

      12034

      one two oh three four

      Digit strings have no specific length limit, but we recommend a maximum of 20 digits. When you group digits using spaces or hyphens, the output includes commas to create pauses between the groups. You can use up to 5 groups.

      Digit strings separated by spaces or hyphens

      1-23-456 7890

      one, two three, four five six, seven eight nine oh

      A digit string prefixed with a plus sign (+), with groups separated by spaces or hyphens

      +43-211-0567

      plus four three, two one one, oh five six seven

      A digit string with the first group enclosed in parentheses, with subsequent groups separated by spaces or hyphens

      (21) 654-3210

      two one, six five four, three two one oh

    • address

      Format

      Example

      Chinese output

      Description

      Common address format

      Yuanhe Town, Jiayuan 30-9

      Yuanhe Town, Jiayuan thirty dash nine

      Supports common formats for standard postal addresses.

      Shitai Road, Lane 388, No. 1107-1108

      Shitai Road, Lane three eight eight, No. one one zero seven dash one one zero eight

      CR Land 24 City, Phase VI, Jinyun Mansion 3-1-3205

      CR Land 24 City, Phase VI, Jinyun Mansion three dash one dash three two zero five

      Shenghua Mingdu Building, Block 2, Room 2006

      Shenghua Mingdu Building, Block two, Room two zero zero six

      Wuchang Street Courtyard, Block 5, Unit 4, 201

      Wuchang Street Courtyard, Block five, Unit four, two zero one

      Furongjiang Road, Lane 150, No. 19

      Furongjiang Road, Lane one five zero, No. nineteen

      This tag is not supported for English text.

    • id

      Format

      Example

      Output

      Description

      string

      dell0101

      D E L L zero one zero one

      Supports uppercase and lowercase letters, Arabic numerals (0–9), and underscores.

      The spaces in the output indicate pauses between characters. The string is read aloud character by character.

      myid_1998

      M Y I D underscore one nine nine eight

      AiTest

      A I T E S T

      For English text, this tag behaves like the characters tag.

    • characters

      Format

      Example

      Chinese output

      Description

      string

      ISBN 1-001-099098-1

      I S B N 一 杠 零 零 一 杠 零 九 九 零 九 八 杠 一

      Supports Chinese characters, uppercase and lowercase English letters, Arabic numerals 0-9, and some full-width and half-width characters.

      Spaces in the output represent pauses, so the text is read one character at a time. If the text inside the tag contains special XML characters, they must be escaped.

      x10b2345_u

      x 1 0 b 2 3 4 5 _ u

      v1.0.1

      v 1.0.1

      version number 2.0

      Version 2.0

      Su M MA000

      Su M M A 0 0 0

      Airbus A330

      Airbus A 3 3 0

      model s01 s02 and s03

      Models 0 1 s 02 and s 0 3

      Airbus A330

      Airbus A 3 3 0

      αβγ

      Alpha Beta Gamma

      Format

      Example

      English output

      Description

      string

      *b+3$.c-0'=α

      asterisk b plus three dollar sign dot c dash zero apostrophe equals alpha

      Supports Chinese characters, uppercase and lowercase English letters, Arabic numerals 0-9, and some full-width and half-width characters.

      Spaces in the output represent pauses, so the text is read one character at a time.

      If the text inside the tag contains special XML characters, they must be escaped.

    • Punctuation

      Format

      Example

      Output

      Description

      Punctuation

      ellipsis

      Supports common Chinese and English punctuation. Spaces in the output add a pause between characters, so they are read one at a time.

      Escape special XML characters within the tag.

      ……

      ellipsis

      !"#$%&

      exclamation mark double quote hash sign dollar sign percent sign ampersand

      ‘()*+

      single quote left parenthesis right parenthesis asterisk plus sign

      ,-./:;

      comma hyphen dot slash colon semicolon

      <=>?@

      less-than sign equals sign greater-than sign question mark at sign

      [\]^_

      left square bracket backslash right square bracket caret underscore

      For English text, this tag is identical to the characters tag.

    • Date

      Format

      Example

      Chinese output

      Description

      Year

      71

      seventy-one

      Supports 2-digit and 4-digit years.

      • 2-digit years: Supports values in the ranges 60–99, 00–09, and 10–19.

      • 4-digit years: Supports values in the ranges 1000–1999 and 2000–2099.

      04

      zero four

      19

      nineteen

      1011

      one zero one one

      1998

      nineteen ninety-eight

      2008

      two thousand eight

      Year and month

      98-4

      ninety-eight April

      Supports months 1 through 9 with or without a leading zero. For example, 1908-4 and 1908-04.

      1998-04

      April 1998

      08-8

      August 2008

      2008-8

      August 2008

      Year, month, and day

      98-4-23

      April 23, 1998

      Supports days 1 through 9 with or without a leading zero. For example, 1908-4-8 and 1908-04-08.

      1998-04-23

      April 23, 1998

      08-8-8

      August 8, 2008

      2008-08-08

      August 8, 2008

      Year, month, and day

      98-4-23

      April 23, 1998

      Supports days 1 through 9 with or without a leading zero. For example, 1908-4-8 and 1908-04-08.

      1998-04-23

      April 23, 1998

      08/8/8

      August 8, 2008

      2008-08-08

      August 8, 2008

      Month and day

      3/20

      March 20

      None

      08/07

      August 7

      Year-month abbreviation

      2018/08

      August 2018

      Supports /, -, and . as separators.

      2018-08

      August 2018

      2018.08

      August 2018

      Year-month-day abbreviation

      2018/08/08

      August 8, 2018

      2018-8-8

      August 8, 2018

      2018.08.08

      August 8, 2018

      Date range (cross-year)

      04/9/1~30

      September 1-30, 2004

      Supports ~ and - to represent "to".

      2004/09/01-2008/06/08

      September 1, 2004 to June 8, 2008

      Date range (same month)

      04/9/1~30

      September 1-30, 2004

      2004/09/01-2008/06/08

      September 1, 2004 to June 8, 2008

      Month range (cross-year)

      01/04~10/04

      April 2001 to April 2010

      2001/04~2010/04

      April 2001 to April 2010

      Date range (same year)

      10/1~10/7

      October 1 to October 7

      10/01~10/07

      October 1st to October 7th

      Date range (same month)

      10/1~7

      October 1st to 7th

      10/01~07

      October 1st to 7th

      Abbreviated date range

      2018/03/03~2019/01/01

      March 3, 2018 to January 1, 2019

      Supports / and . as separators, and ~ and - to represent "to".

      1997.9.9~1998.9.9

      September 9, 1997 to September 9, 1998

      Abbreviated month-day range

      10/20~10/31

      October 20th to October 31st

      Month range

      1~10

      January to October

      1/~10/

      January to October

      Month-day-year abbreviation

      10/20/2018

      October 20, 2018

      This format supports only 4-digit years, the "month/day/year" order, and the / separator.

      Format

      Example

      English output

      Description

      YYYY/YY or YYYY-YY

      2000/01

      two thousand, oh one

      This format applies to cross-year ranges.

      1900-01

      nineteen hundred, oh one

      2001-02

      twenty oh one, oh two

      2019-20

      twenty nineteen, twenty

      1998-99

      nineteen ninety eight, ninety nine

      1999-00

      nineteen ninety nine, oh oh

      YYYY

      2000

      two thousand

      This format represents a four-digit year.

      1900

      nineteen hundred

      1905

      nineteen oh five

      2021

      twenty twenty one

      WWW-WWW

      or

      WWW~WWW

      or

      WWW&WWW

      mon-wed

      monday to wednesday

      Escape any special XML characters when specifying day-of-the-week ranges.

      tue~fri

      tuesday to friday

      sat&sun

      saturday and sunday

      DD-DD MMM, YYYY

      or

      DD~DD MMM, YYYY

      or

      DD&DD MMM, YYYY

      19-20 Jan, 2000

      the nineteenth to the twentieth of january two thousand

      DD represents a two-digit day, MMM represents a three-letter month abbreviation or the full month name, and YYYY represents a four-digit year in the 1000s or 2000s.

      01 ~ 10 Jul, 2020

      the first to the tenth of july twenty twenty

      05&06 Apr, 2009

      the fifth and the sixth of april two thousand nine

      MMM DD-DD

      or

      MMM DD~DD

      or

      MMM DD&DD

      Feb 01 - 03

      february the first to the third

      MMM represents a three-letter month abbreviation or the full month name, and DD represents a two-digit day.

      Aug 10~20

      august the tenth to the twentieth

      Dec 11&12

      december the eleventh and the twelfth

      MMM-MMM

      or

      MMM~MMM

      or

      MMM&MMM

      Jan-Jun

      january to june

      MMM represents a three-letter month abbreviation or the full month name.

      jul ~ dec

      july to december

      sep&oct

      september and october

      YYYY-YYYY

      or

      YYYY~YYYY

      1990 - 2000

      nineteen ninety to two thousand

      YYYY represents a four-digit year in the 1000s or 2000s.

      2001~2021

      two thousand one to twenty twenty one

      WWW DD MMM YYYY

      Sun 20 Nov 2011

      sunday the twentieth of november twenty eleven

      In these formats: WWW is the day of the week (abbreviated or full name), DD is a two-digit day, MM is a two-digit month, MMM is the month (three-letter abbreviation or full name), and YYYY is a four-digit year in the 1000s or 2000s.

      WWW DD MMM

      Sun 20 Nov

      sunday the twentieth of november

      WWW MMM DD YYYY

      Sun Nov 20 2011

      sunday november the twentieth twenty eleven

      WWW MMM DD

      Sun Nov 20

      sunday november the twentieth

      WWW YYYY-MM-DD

      Sat 2010-10-01

      saturday october the first twenty ten

      WWW YYYY/MM/DD

      Sat 2010/10/01

      saturday october the first twenty ten

      WWW MM/DD/YYYY

      Sun 11/20/2011

      sunday november the twentieth twenty eleven

      MM/DD/YYYY

      11/20/2011

      november the twentieth twenty eleven

      YYYY

      1998

      nineteen ninety eight

      Other default readings

      10 Mar, 2001

      the tenth of march two thousand one

      None

      10 Mar

      the tenth of march

      Mar 2001

      march two thousand one

      Fri. 10/Mar/2001

      friday the tenth of march two thousand one

      Mar 10th, 2001

      march the tenth two thousand one

      Mar 10

      march the tenth

      2001/03/10

      march the tenth two thousand one

      2001-03-10

      march the tenth two thousand one

      2000s

      two thousands

      2010's

      twenty tens

      1900's

      nineteen hundreds

      1990s

      nineteen nineties

    • time

      Format

      Example

      Chinese output

      Description

      time

      12:00

      12:00

      Supports common time formats and ranges.

      12:00:00

      twelve o'clock

      10:20

      ten twenty

      10:20:30

      ten twenty thirty seconds

      09:18:14

      nine eighteen fourteen seconds

      time range

      11:00~12:00

      eleven o'clock to twelve o'clock

      09:00-14:00

      nine o'clock to fourteen o'clock

      11:00~11:30

      eleven o'clock to eleven thirty

      11:00-12:18

      eleven o'clock to twelve eighteen

      10:30~11:00

      ten thirty to eleven o'clock

      09:28-10:00

      nine twenty-eight to ten o'clock

      10:20~11:20

      ten twenty to eleven twenty

      06:00~08:00

      six o'clock to eight o'clock

      AM 10:20~PM 13:30

      10:20 AM to 1:30 PM

      time abbreviation

      5:00 am

      5:00 AM

      5:30 am

      5:30 AM

      5:20:12 am

      5:20:12 AM

      7:00 am

      7:00 AM

      7:30 AM

      7:30 AM

      7:20:12 a.m.

      7:20:12 AM

      07:08:12 A.M.

      7:08:12 AM

      5:00 pm

      5:00 PM

      5:30 PM

      5:30 PM

      5:20:12 p.m.

      5:20:12 PM

      05:09:12 P.M.

      5:09:12 PM

      9:00 pm

      9:00 PM

      9:30 pm

      9:30 PM

      9:20:12 PM

      9:20:12 PM

      9:02:12 P.M.

      9:02:12 PM

      12:00 pm

      12:00 PM

      12:30 p.m.

      12:30 PM

      12:20:12 PM

      12:20:12 PM

      Format

      Example

      English output

      Description

      HH:MM AM/PM

      09:00 AM

      nine A M

      HH is the one- or two-digit hour, MM is the two-digit minute, and AM/PM indicates morning or afternoon.

      09:03 PM

      nine oh three P M

      09:13 p.m.

      nine thirteen p m

      HH:MM

      21:00

      twenty-one hundred

      HMM

      100

      one o'clock

      time range

      8:00 am - 05:30 pm

      eight a m to five thirty p m

      Supports common time formats and ranges.

      7:05~10:15 AM

      seven oh five to ten fifteen A M

      09:00-13:00

      nine o'clock to thirteen hundred

    • currency

      Format

      Example

      Chinese output

      Description

      Number + currency identifier

      12.00 RMB

      twelve renminbi

      Supported currency identifiers: AUD (australian dollar), CAD (canadian dollar), HKD (Hong Kong dollar), JPY (japanese yen), USD (united states dollar), CHF (swiss franc), NOK (norwegian krone), SEK (swedish krona), GBP (british pound), RMB (renminbi), CNY (yuan), and EUR (euro).

      Supported number formats include integers, decimals, and numbers formatted with comma separators.

      12.50 RMB

      twelve point five zero renminbi

      12,000,000 RMB

      twelve million renminbi

      12,000,000.00 RMB

      twelve million renminbi

      12,000.35 RMB

      twelve thousand point three five renminbi

      Currency identifier + number

      $12

      twelve united states dollars

      Supported currency identifiers: CAD (canadian dollar), $ (united states dollar), Fr (franc), kr (danish krone), £ (british pound), ¥ (yuan), and € (euro).

      Supported number formats include integers, decimals, and numbers formatted with comma separators.

      $12.00

      twelve united states dollars

      $12.12

      twelve point one two united states dollars

      $12,000

      twelve thousand united states dollars

      $12,000.00

      twelve thousand united states dollars

      $12,000.99

      twelve thousand point nine nine united states dollars

      Other default readings

      1213

      one thousand two hundred thirteen

      None

      1213 KML

      one thousand two hundred thirteen K M L

      1213.00 KML

      one thousand two hundred thirteen K M L

      1213.9 KML

      one thousand two hundred thirteen point nine K M L

      1,000 KML

      one thousand K M L

      1,000.00 KML

      one thousand K M L

      1,000.98 KML

      one thousand point nine eight K M L

      12,000

      twelve thousand

      Format

      Example

      English output

      Description

      Number + currency identifier

      1.00 RMB

      one yuan

      Supported number formats include integers, decimals, and numbers formatted with comma separators.

      Supported currency identifiers:

      CN¥ (yuan)

      CNY (yuan)

      RMB (yuan)

      AUD (australian dollar)

      CAD (canadian dollar)

      CHF (swiss franc)

      DKK (danish krone)

      EUR (euro)

      GBP (british pound)

      HKD (Hong Kong dollar)

      JPY (japanese yen)

      NOK (norwegian krone)

      SEK (swedish krona)

      SGD (singapore dollar)

      USD (united states dollar)

      2.02 CNY

      two point zero two yuan

      1,000.23 CN¥

      one thousand point two three yuan

      1.01 SGD

      one singapore dollar and one cent

      2.01 CAD

      two canadian dollars and one cent

      3.1 HKD

      three Hong Kong dollars and ten cents

      1,000.00 EUR

      one thousand euros

      Currency identifier + number

      US$ 1.00

      one united states dollar

      Supported number formats include integers, decimals, and numbers formatted with comma separators.

      Supported currency identifiers:

      US$ (united states dollar)

      CA$ (canadian dollar)

      AU$ (australian dollar)

      SG$ (singapore dollar)

      HK$ (Hong Kong dollar)

      C$ (canadian dollar)

      A$ (australian dollar)

      $ (united states dollar)

      £ (british pound)

      € (euro)

      CN¥ (yuan)

      CNY (yuan)

      RMB (yuan)

      AUD (australian dollar)

      CAD (canadian dollar)

      CHF (swiss franc)

      DKK (danish krone)

      EUR (euro)

      GBP (british pound)

      HKD (Hong Kong dollar)

      JPY (japanese yen)

      NOK (norwegian krone)

      SEK (swedish krona)

      SGD (singapore dollar)

      USD (united states dollar)

      $0.01

      one cent

      JPY 1.01

      one japanese yen and one sen

      £1.1

      one british pound and ten pence

      €2.01

      two euros and one cent

      USD 1,000

      one thousand united states dollars

      Number + quantifier + currency identifier

      or

      Currency identifier + number + quantifier

      1.23 Tn RMB

      one point two three trillion yuan

      Supported quantifier formats include:

      thousand

      million

      billion

      trillion

      Mil (million)

      mil (million)

      Bil (billion)

      bil (billion)

      MM (million)

      Bn (billion)

      bn (billion)

      Tn (trillion)

      tn (trillion)

      K (thousand)

      k (thousand)

      M (million)

      m (million)

      $1.2 K

      one point two thousand united states dollars

    • measure

      Format

      Example

      Chinese output

      Description

      Number + Chinese unit

      2

      two

      Supports common Chinese units and unit abbreviations.

      120 hectares

      one hundred twenty hectares

      over 100 mg

      over one hundred milligrams

      about 100 meters

      about one hundred meters

      over 100 people

      over one hundred people

      1cm 20mm

      one centimeter twenty millimeters

      120.00 sq km

      one hundred twenty square kilometers

      Number + unit abbreviation

      120.56 cm²

      one hundred twenty point five six square centimeters

      120 ㎡ 56 cm²

      one hundred twenty square meters fifty-six square centimeters

      100 m 12 cm 6 mm

      one hundred meters twelve centimeters six millimeters

      Range

      10~15 kg

      ten to fifteen kilograms

      10.24~789.82 mu

      ten point two four to seven hundred eighty-nine point eight two mu

      10m~15m

      ten meters to fifteen meters

      10.24 cm~19.08 cm

      ten point two four centimeters to nineteen point zero eight centimeters

      Number + unit/unit

      10 yuan/jin

      10 yuan per jin

      199~299 yuan/piece

      199 to 299 yuan per piece

      299.99 yuan/g~399.99 yuan/g

      299.99 yuan per gram to 399.99 yuan per gram

      Other default readings

      12 bundles

      12 bundles

      30 rm

      30 r m

      400 million compatriots

      400 million compatriots

      12.897 micrograms

      12.897 micrograms

      Format

      Example

      English output

      Description

      Number + unit of measurement

      1.0 kg

      one kilogram

      Supports integers, decimals, and comma-separated numbers.

      Supports common unit abbreviations.

      1,234.01 km

      one thousand two hundred thirty-four point zero one kilometers

      Unit of measurement

      mm2

      square millimeter

    • The following table shows how common symbols are pronounced with the <say-as> tag.

      Symbol

      Chinese name

      English name

      !

      exclamation mark

      exclamation mark

      quotation marks

      double quote

      #

      hash symbol

      hash

      $

      dollar sign

      dollar sign

      %

      percent sign

      percent sign

      &

      ampersand

      ampersand

      Single quote

      single quote

      Left parenthesis

      left parenthesis

      Right parenthesis

      right parenthesis

      *

      Asterisk

      asterisk

      +

      Plus sign

      plus sign

      ,

      Comma

      comma

      -

      Hyphen

      hyphen

      .

      Period

      dot

      /

      Slash

      slash

      Colon

      colon

      Semicolon

      semicolon

      <

      Less-than sign

      less-than sign

      =

      Equal sign

      equals sign

      >

      Greater-than sign

      greater-than sign

      ?

      Question mark

      question mark

      @

      At symbol

      at sign

      [

      Left square bracket

      left bracket

      \

      Backslash

      backslash

      ]

      Right square bracket

      right bracket

      ^

      Caret

      caret

      _

      Underscore

      underscore

      Backtick

      backtick

      {

      Left Curly Brace

      left brace

      |

      Pipe

      vertical bar

      }

      Right Curly Brace

      right brace

      ~

      Tilde

      tilde

      Exclamation Mark

      exclamation mark

      Left Double Quote

      left double quote

      Right Double Quote

      right double quote

      Left Single Quote

      left single quote

      Right Single Quote

      right single quote

      Left Parenthesis

      left parenthesis

      Right Parenthesis

      right parenthesis

      Comma

      comma

      Period

      period

      Dash

      em dash

      Colon

      colon

      Semicolon

      semicolon

      Question Mark

      question mark

      Enumeration Comma

      enumeration comma

      Ellipsis

      ellipsis

      ……

      Ellipsis

      ellipsis

      Left angle bracket

      left book title mark

      Right angle bracket

      right book title mark

      Yuan symbol

      yuan sign

      Greater than or equal to

      greater than or equal to

      Less than or equal to

      less than or equal to

      Not equal to

      not equal to

      Approximately equal to

      approximately equal to

      ±

      Plus-minus

      plus or minus

      ×

      Multiplication sign

      multiplication sign

      π

      Pi

      pi

      Α

      Alpha

      alpha

      Β

      Beta

      beta

      Γ

      Gamma

      gamma

      Δ

      Delta

      delta

      Ε

      Epsilon

      epsilon

      Ζ

      Zeta

      zeta

      Θ

      Theta

      theta

      Ι

      Iota

      iota

      Κ

      Kappa

      kappa

      Λ

      Lambda

      lambda

      Μ

      Mu

      mu

      Ν

      Nu

      nu

      Ξ

      Xi

      xi

      Ο

      Omicron

      omicron

      Pi

      pi

      Ρ

      Rho

      rho

      Sigma

      sigma

      Τ

      Tau

      tau

      Υ

      Upsilon

      upsilon

      Φ

      Phi

      phi

      Χ

      Chi

      chi

      Ψ

      Psi

      psi

      Ω

      Omega

      omega

      α

      Alpha

      alpha

      β

      Beta

      beta

      γ

      Gamma

      gamma

      δ

      Delta

      delta

      ε

      Epsilon

      epsilon

      ζ

      Zeta

      zeta

      η

      Eta

      eta

      θ

      Theta

      theta

      ι

      Iota

      iota

      κ

      Kappa

      kappa

      λ

      Lambda

      lambda

      μ

      Mu

      mu

      ν

      Nu

      nu

      ξ

      Xi

      xi

      ο

      Omicron

      omicron

      π

      Pi

      pi

      ρ

      Rho

      rho

      σ

      Sigma

      sigma

      τ

      Tau

      tau

      υ

      Upsilon

      upsilon

      φ

      Phi

      phi

      χ

      Chi

      chi

      ψ

      Psi

      psi

      ω

      Omega

      omega

    • The table below lists common units of measure for <say-as>.

      Format

      Category

      Chinese example

      English example

      Abbreviation

      Length

      nm (nanometer), μm (micrometer), mm (millimeter), cm (centimeter), m (meter), km (kilometer), ft (foot), in (inch)

      nm (nanometer), μm (micrometer), mm (millimeter), cm (centimeter), m (meter), km (kilometer), ft (foot), in (inch)

      Area

      cm² (square centimeter), m² (square meter), km² (square kilometer), SqFt (square foot)

      cm² (square centimeter), m² (square meter), km² (square kilometer), SqFt (square foot)

      Volume

      cm³ (cubic centimeter), m³ (cubic meter), km³ (cubic kilometer), mL (milliliter), L (liter), gal (gallon)

      cm³ (cubic centimeter), m³ (cubic meter), km3 (cubic kilometer), mL (milliliter), L (liter), gal (gallon)

      Weight

      μg (microgram), mg (milligram), g (gram), kg (kilogram)

      μg (microgram), mg (milligram), g (gram), kg (kilogram)

      Time

      min (minute), sec (second), ms (millisecond)

      min (minute), sec (second), ms (millisecond)

      Electromagnetic

      μA (microampere), mA (milliampere), Ω (ohm), Hz (hertz), kHz (kilohertz), MHz (megahertz), GHz (gigahertz), V (volt), kV (kilovolt), kWh (kilowatt-hour)

      μA (microampere), mA (milliampere), Ω (ohm), Hz (hertz), kHz (kilohertz), MHz (megahertz), GHz (gigahertz), V (volt), kV (kilovolt), kWh (kilowatt-hour)

      Sound

      dB (decibel)

      dB (decibel)

      Pressure

      Pa (pascal), kPa (kilopascal), MPa (megapascal)

      Pa (pascal), kPa (kilopascal), MPa (megapascal)

      Other common units

      Supports Chinese units not limited to the categories above, such as 'meter', 'second', 'US dollar', and 'milliliters per bottle'. Also supports Chinese measure words, such as units for planes, events, animals, movies, and pots.

      Supports other units not listed above, including tsp (teaspoon), rpm (revolutions per minute), KB (kilobyte), and mmHg (millimeter of mercury).

  • Tag relationship

    The <say-as> tag can contain text and <VHML/>.

  • Example

    • Cardinal

      <speak>
        <say-as interpret-as="cardinal">12345</say-as>
      </speak>
      <speak>
        <say-as interpret-as="cardinal">10234</say-as>
      </speak>
    • Digits

      <speak>
        <say-as interpret-as="digits">12345</say-as>
      </speak>
      <speak>
        <say-as interpret-as="digits">10234</say-as>
      </speak>
    • Telephone

      <speak>
        <say-as interpret-as="telephone">12345</say-as>
      </speak>
      <speak>
        <say-as interpret-as="telephone">10234</say-as>
      </speak>
    • Name

      <speak>
        Her former name is <say-as interpret-as="name">Zeng Xiaofan</say-as>
      </speak>
    • Address

      <speak>
        <say-as interpret-as="address">Fulu International, Building 1, Unit 3, Room 304</say-as>
      </speak>
    • Id

      <speak>
        <say-as interpret-as="id">myid_1998</say-as>
      </speak>
    • Characters

      <speak>
        <say-as interpret-as="characters">Greek letters αβ</say-as>
      </speak>
      <speak>
        <say-as interpret-as="characters">*b+3.c$=α</say-as>
      </speak>
    • Punctuation

      <speak>
        <say-as interpret-as="punctuation"> -./:;</say-as>
      </speak>
    • Date

      <speak>
        <say-as interpret-as="date">1000-10-10</say-as>
      </speak>
      <speak>
        <say-as interpret-as="date">10-01-2020</say-as>
      </speak>
    • Time

      <speak>
        <say-as interpret-as="time">5:00am</say-as>
      </speak>
      <speak>
        <say-as interpret-as="time">0500</say-as>
      </speak>
    • Currency

      <speak>
        <say-as interpret-as="currency">13,000,000.00 RMB</say-as>
      </speak>
      <speak>
        <say-as interpret-as="currency">$1,000.01</say-as>
      </speak>
    • Measure

      <speak>
        <say-as interpret-as="measure">100 m 12 cm 6 mm</say-as>
      </speak>
      <speak>
        <say-as interpret-as="measure">1,000.01 kg</say-as>
      </speak>