Skip to main content

SSML and LaTeX

Use SSML to control voice characteristics such as speech rate, pitch, and volume, and use LaTeX to read Chinese mathematical formulas aloud. This article introduces the supported scope, invocation examples, and tag and symbol references.

Feature overview

SSML is an XML-based speech synthesis markup language that can set voice characteristics such as timbre, speaking rate, pitch, and volume, control pauses, specify pronunciation and reading styles, and add background music and sound effects. The LaTeX formula reading feature of CosyVoice converts mathematical formulas in text into Chinese speech. These two features can be used for audiobooks, customer service information announcements, multilingual pronunciation, and online education. The applicable models, voices, and interfaces for each feature are described below. For model selection, see Speech synthesis.

Limits

  • SSML
  • LaTeX
  • Supported models: qwen-audio-3.1-tts-plus, qwen-audio-3.1-tts-flash, qwen-audio-3.0-tts-flash, qwen-audio-3.0-tts-plus, cosyvoice-v3.5-flash, cosyvoice-v3.5-plus, cosyvoice-v3-flash, cosyvoice-v3-plus, cosyvoice-v2
  • Voices: Only cloned voices and the system voices marked as supporting SSML in the Qwen-Audio-TTS voice list and CosyVoice voice list are available.
  • Interfaces:
    • Java SDK (v2.20.3 or later): supports non-streaming calls and one-way streaming calls
    • Python SDK (v2.0.1 or later): supports non-streaming calls and one-way streaming calls
    • WebSocket API: you must set the enable_ssml parameter to true, and the continue-task event can be sent only once

Usage

  • SSML
  • LaTeX
When using SSML, follow these rules:
  • All text must be placed in <speak></speak>. Multiple <speak> tags can be used side by side; nesting is not supported.
  • Special XML characters inside tags must be escaped: " → &quot;, ' → &apos;, & → &amp;, < → &lt;, > → &gt;.

QuickStart

The following example shows how to use SSML to control the speaking rate for speech synthesis. Before running it, complete the following preparations:
  1. Obtain and configure an API Key
  2. Install the DashScope SDK (Python 2.0.1 or later, Java 2.20.3 or later). For details, see Install the SDK.
cosyvoice-v3.5-plus and cosyvoice-v3.5-flash do not provide system voices. To use these two models in the SSML examples in this section, you must first create a cloned voice through voice cloning.
  • Java SDK
  • Python SDK
  • WebSocket API
import com.alibaba.dashscope.audio.ttsv2.SpeechSynthesisParam;
import com.alibaba.dashscope.audio.ttsv2.SpeechSynthesizer;
import com.alibaba.dashscope.utils.Constants;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;

/**
 * SSML feature description:
 *     1. Only non-streaming calls and unidirectional streaming calls support the SSML feature
 * Use an SSML-compatible cloned or preset voice (such as longanyang for cosyvoice-v3-flash). See this page for supported models.
 */
public class Main {
    private static String model = "cosyvoice-v3-flash";
    private static String voice = "longanyang";

    public static void main(String[] args) {
        // Singapore region URL. Replace WorkspaceId with your actual workspace ID. The URL varies by region.
        Constants.baseWebsocketApiUrl = "wss://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api-ws/v1/inference";
        streamAudioDataToSpeaker();
        System.exit(0);
    }

    public static void streamAudioDataToSpeaker() {
        SpeechSynthesisParam param =
                SpeechSynthesisParam.builder()
                        // The API Keys for the Singapore and Beijing regions are different. Get an API Key: https://www.alibabacloud.com/help/model-studio/get-api-key
                        // If you have not configured an environment variable, replace the following line with your Model Studio API Key: .apiKey("sk-xxx")
                        .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                        .model(model)
                        .voice(voice)
                        .build();

        SpeechSynthesizer synthesizer = new SpeechSynthesizer(param, null);
        ByteBuffer audio = null;
        try {
            // Non-streaming call, blocks until audio is returned
            // Special characters need to be escaped
            audio = synthesizer.call("<speak rate=\"2\">I am speaking faster than usual.</speak>");
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            // Close the WebSocket connection when the task ends
            synthesizer.getDuplexApi().close(1000, "bye");
        }
        if (audio != null) {
            // Save audio data to local file "output.mp3"
            File file = new File("output.mp3");
            try (FileOutputStream fos = new FileOutputStream(file)) {
                fos.write(audio.array());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        // The first text transmission requires establishing a WebSocket connection, so the first packet latency includes the connection setup time
        System.out.println(
                "[Metric] requestId: "
                        + synthesizer.getLastRequestId()
                        + ", first packet latency (ms): "
                        + synthesizer.getFirstPackageDelay());
    }
}

SSML tags

The implementation references the W3C SSML 1.0 specification. The supported tags are subject to the descriptions below; not all standard tags are supported.

<speak>: root node

<speak> is the root node of all SSML tags. When you use SSML features, the text content must be enclosed in <speak></speak> tags.
<speak>Text that requires SSML processing</speak>
  • Attributes
  • Examples
  • Tag relationships
Attribute nameAttribute typeRequiredDescription
voiceStringNoSpecifies the speaker (voice).This attribute takes precedence over the speaker specified by the voice API request parameter.
rateStringNoSpecifies the speech rate. This attribute takes precedence over the speech rate specified by the API request parameter rate.
  • Value range: a decimal between [0.5,2]
  • Default value: 1
    • Greater than 1 indicates a faster speech rate
    • Less than 1 indicates a slower speech rate
pitchStringNoSpecifies the pitch. This attribute takes precedence over the pitch specified by the API request parameter pitch.
  • Value range: a decimal between [0.5,2]
  • Default value: 1
    • Greater than 1 indicates a higher pitch
    • Less than 1 indicates a lower pitch
volumeStringNoSpecifies the volume. This attribute takes precedence over the volume specified by the API request parameter volume.
  • Value range: an integer between [0,100]
  • Default value: 50
    • Greater than 50 indicates a louder volume
    • Less than 50 indicates a softer volume
effectStringNoSpecifies the sound effect.
  • Value range:
    • robot: robot voice effect
    • lolita: lolita voice effect
    • lowpass: low-pass effect
    • echo: echo effect
    • eq: equalizer (advanced)
    • lpfilter: low-pass filter (advanced)
    • hpfilter: high-pass filter (advanced)
    • eq, lpfilter, and hpfilter are advanced sound effect types, and their specific effects can be customized via the effectValue parameter.
    • Each SSML tag supports only one sound effect; setting multiple effect attributes at the same time is not allowed.
    • Enabling the sound effect feature increases the synthesis latency.
effectValueStringNoUsed to further configure the specific effects of the sound effect (the effect parameter), applicable to the three advanced sound effect types: eq, lpfilter, and hpfilter.
  • Value range:
    • eq (equalizer): The system supports 8 frequency levels by default, with the corresponding frequencies as follows: [“40 Hz”,“100 Hz”, “200 Hz”, “400 Hz”, “800 Hz”, “1600 Hz”, “4000 Hz”, “12000 Hz”]。 The bandwidth of each frequency band is 1.0q. Specify the gain value of each frequency band via the effectValue parameter: this parameter is a string consisting of 8 integers, with values in the range [-20, 20], separated by spaces. A value of 0 means no adjustment to the gain of the corresponding frequency. For example: effectValue="1 1 1 1 1 1 1 1"
    • lpfilter (low-pass filter): specifies the cutoff frequency of the low-pass filter, an integer in the range (0, target sample rate/2]. For example, effectValue="800".
    • hpfilter (high-pass filter): specifies the cutoff frequency of the high-pass filter, an integer in the range (0, target sample rate/2]. For example, effectValue="1200".
bgmStringNoAdds background music to the synthesized speech.The audio file must be stored on Alibaba Cloud OSS and be accessible via a public network URL. For how to upload files, see Upload files. For private files, use a valid signed URL. XML special characters in the URL must be escaped; for example, write & as &amp;.
  • Audio requirements: There is no upper limit on the background audio file size, but larger files take longer to download. If the duration of the synthesized speech exceeds that of the background audio, the background audio will automatically loop.
    • Sampling rate: 16kHz
    • Channels: mono
    • File format: WAV If the original audio is not in WAV format, you can use the ffmpeg tool to convert it:
      ffmpeg -i input_audio -acodec pcm_s16le -ac 1 -ar 16000 output.wav
      
    • Bit depth: 16 bits
The uploader shall bear the corresponding legal responsibility for the copyright of the uploaded audio.
backgroundMusicVolumeStringNoSpecifies the volume of the background music. Must be used together with the bgm attribute.

<break>: controls the pause

Inserts a silent pause during speech synthesis to simulate a natural pause in speaking. Supports two units: seconds (s) and milliseconds (ms).
<!-- No attributes -->
<break/>
<!-- With time attribute -->
<break time="string"/>
  • Attributes
  • Examples
  • Tag relationships
Attribute nameAttribute typeRequiredDescription
timeStringNoSets the pause duration, supporting both seconds and milliseconds (for example, "2s" or "50ms").
  • Value range:
    • In seconds (s), the value is an integer in the range [1, 10]
    • In milliseconds (ms), the value is an integer in the range [50, 10000]
When multiple <break> tags are used consecutively, the total pause duration is the sum of the durations of each tag. If the total exceeds 10 seconds, only the first 10 seconds are retained.
An <break> tag without attributes pauses for 1 second by default.

<sub>: substitute text

Replaces the specified text with content more suitable for reading aloud. For example, read "W3C" as "network protocol standards".
<sub alias="string"></sub>
  • Attributes
  • Examples
  • Tag relationships
Attribute nameAttribute typeRequiredDescription
aliasStringYesSpecifies the spoken content that replaces the original text.

<phoneme>: specify pronunciation

Precisely controls how text is pronounced. For Chinese, pronunciation can be specified with pinyin; for English, CMU phonetic symbols can be used. It applies to scenarios such as disambiguating polyphonic characters and pronouncing foreign words.
<phoneme alphabet="string" ph="string">Text</phoneme>
  • Attributes
  • Examples
  • Tag relationships
Attribute nameAttribute typeRequiredDescription
alphabetStringYesSpecifies the pronunciation type: pinyin (for Chinese) or phonetic symbols (for English).Value range:
phStringYesSpecifies the specific pinyin or phonetic symbols. Usage rules:
  • Separate the pinyin of multiple Chinese characters with spaces, and the number of pinyin syllables must match the number of characters.
  • Each pinyin syllable consists of the pronunciation and the tone, where the tone is an integer from 1 to 5, and 5 indicates the neutral tone.

<soundEvent>: Insert a sound effect

Inserts a sound effect file (such as a prompt tone or ambient sound) at a specified position in the speech to enrich the expressiveness of the voice.
<soundEvent src="URL"/>
  • Attributes
  • Examples
  • Tag relationships
Attribute nameAttribute typeRequiredDescription
srcStringYesSpecifies the URL of an external audio file.The audio file must be stored on Alibaba Cloud OSS and be accessible via a public network URL. For how to upload files, see Upload files. For private files, use a valid signed URL. XML special characters in the URL must be escaped; for example, write & as &amp;.
  • Audio requirements:
    • Sampling rate: 16kHz
    • Channels: mono
    • File format: WAV If the original audio is not in WAV format, you can use the ffmpeg tool to convert it:
      ffmpeg -i input_audio -acodec pcm_s16le -ac 1 -ar 16000 output.wav
      
    • File size: no more than 2 MB
    • Bit depth: 16 bits
The uploader shall bear the corresponding legal responsibility for the copyright of the uploaded audio.

<say-as>: Set reading rules

Specifies the content type of the text (such as numbers, dates, or phone numbers), and the system reads it aloud according to the standard reading rules for the corresponding type.
<say-as interpret-as="string">Text</say-as>
  • Attributes
  • Examples
  • Tag relationships
Attribute nameAttribute typeRequiredDescription
interpret-asStringYesSpecifies the content type of the text within the tag.Value range:
  • cardinal: reads the text as a standard integer or decimal
  • digits: reads each digit one by one (e.g., 123 → one two three)
  • telephone: reads digit by digit in the standard way for phone numbers
  • name: reads according to the standard reading rules for personal names
  • address: reads according to the standard reading rules for addresses
  • id: reads according to the standard reading rules for identifiers (such as account names or nicknames)
  • characters: reads the text within the tag character by character
  • punctuation: reads out the names of punctuation marks within the tag
  • date: reads according to the standard reading rules for date formats
  • time: reads according to the standard reading rules for time formats
  • currency: reads according to the standard reading rules for monetary amounts
  • measure: reads according to the standard reading rules for units of measurement
cardinal
  • Chinese
  • English
FormatExamplesChinese outputDescription
Digit string145One hundred and forty-fiveInteger input range: positive and negative integers within 20 digits, [-99999999999999999999,99999999999999999999]. Decimal input range: there is no special limit on the number of digits after the decimal point, but no more than 10 digits are recommended.
Minus sign + digit string-145Minus one hundred and forty-five
Digit string separated by commas every 3 digits10,000Ten thousand
Minus sign + digit string separated by commas every 3 digits-10,124Minus ten thousand one hundred and twenty-four
Digit string + decimal point + 2 zeros10.00Ten
Minus sign + digit string + decimal point + 2 zeros-110.00Minus one hundred and ten
Digit string + decimal point + digit string79.090Seventy-nine point zero nine zero
Minus sign + digit string + decimal point + digit string-79.001minus seventy-nine point zero zero one
digits
  • Chinese
  • English
FormatExamplesChinese outputDescription
Digit string129090909one two nine zero nine zero nine zero nineThere is no special limit on the length of the digit string; no more than 20 digits are recommended. When the digit string exceeds 10 digits, a pause is inserted after each digit.
telephone
  • Chinese
  • English
FormatExamplesChinese outputDescription
Landline number4930286four nine three zero two eight sixSupports 7~8-digit landline numbers, with spaces and "-" supported as separators. Specifically, 7-digit landline numbers support the "3-4" digit grouping format; 8-digit landline numbers support the "4-4" digit grouping format.
493 0286four nine three zero two eight six
493-0286four nine three zero two eight six
62552560six two five five two five six zero
6255 2560six two five five two five six zero
6255-2560six two five five two five six zero
Landline number + extension number4930286-109four nine three zero two eight six transfer one zero nineSupports 1~4-digit extension numbers.
4930286 transfer 109four nine three zero two eight six transfer one zero nine
4930286 extension 109four nine three zero two eight six extension one zero nine
4930286 extension 109four nine three zero two eight six extension one zero nine
Area code + landline number01062552560zero one zero six two five five two five six zeroSupported area codes: 010, 02x, 03xx, 04xx, 05xx, 07xx, 08xx, 09xx.
010 62552560zero one zero six two five five two five six zero
010 6255 2560zero one zero six two five five two five six zero
010 6255-2560zero one zero six two five five two five six zero
010-62552560zero one zero six two five five two five six zero
010-6255-2560zero one zero six two five five two five six zero
(010)62552560zero one zero six two five five two five six zero
03198907098zero three one nine eight nine zero seven zero nine eight
0319-8907098three one nine eight nine zero seven zero nine eight
Area code + landline number + extension number010 62552560-109zero one zero six two five five two five six zero ext. one zero nineNone
010-62552560-109zero one zero six two five five two five six zero ext. one zero nine
(010)62552560-109zero one zero six two five five two five six zero ext. one zero nine
(010)62552560 ext. 109zero one zero six two five five two five six zero ext. one zero nine
(010)62552560 ext. 109zero one zero six two five five two five six zero ext. one zero nine
(010)62552560 extension 109zero one zero six two five five two five six zero extension one zero nine
Country code + area code + landline number86-010-62791627eight six zero one zero six two seven nine one six two sevenSupported country codes: 86, (86), +86, (+86), 0086. All are uniformly read as "eight six".
(86)10-62791627eight six one zero six two seven nine one six two seven
+86-010-62791627eight six zero one zero six two seven nine one six two seven
0086-10-62791627eight six one zero six two seven nine one six two seven
(+86)-10-6279 1627eight six one zero six two seven nine one six two seven
Country code + area code + landline number + extension number(86)21-58118818-207eight six two one five eight one one eight eight one eight ext. two zero sevenNone
(86)021-5811-8818-207eight six zero two one five eight one one eight eight one eight ext. two zero seven
(86)021-58118818 ext. 207eight six zero two one five eight one one eight eight one eight ext. two zero seven
(86)21-5811-8818 ext. 207eight six two one five eight one one eight eight one eight extension two zero seven
+86-021-58118818 extension 207eight six zero two one five eight one one eight eight one eight extension number two zero seven
Mobile number139 0000 5678one three nine zero zero zero zero five six seven eightSupports 11-digit mobile numbers, with two digit grouping formats: 3-3-5 and 3-4-4
139-000-05678one three nine zero zero zero zero five six seven eight
139 000 05678one three nine zero zero zero zero five six seven eight
Country code + mobile phone number+86-1390000567886 139 0000 5678None
(+86)-139-0000-567886 139 0000 5678
+861390000567886 139 0000 5678
0086-139 000 0567886 139 000 05678
Service number123123Common service numbers are supported. 10-digit service numbers starting with 400/800 are supported, with digits grouped in the "3-3-4" format. 16-digit numbers starting with 12530/17951/12593 are supported.
9567895678
4008110510400 811 0510
800-810-8888800 810 8888
125301352063837712530 135 2063 8377
Others(86)(21)9899-80800-090986 21 9899 80800 0909The "digit string + separator (left and right parentheses, -)" format is supported.
address
  • Chinese
  • English
FormatExamplesChinese outputDescription
Common address formatsJiayuan 30-9, Yuanhe TownJiayuan 30-9, Yuanhe TownCommon address formats are supported. Here, an address refers to a standard mailing address.
No. 1107-1108, Lane 388, Shitai RoadNo. 1107-1108, Lane 388, Shitai Road
3-1-3205, Jinyun Mansion, Phase 6, Huarun 24 City3-1-3205, Jinyun Mansion, Phase 6, Huarun 24 City
Room 2006, Block 2, Shenghua Mingdu TowerRoom 2006, Block 2, Shenghua Mingdu Tower
Room 201, Unit 4, Building 5, Tingyuan, Wuchang SubdistrictRoom 201, Unit 4, Building 5, Tingyuan, Wuchang Subdistrict
No. 19, Lane 150, Furongjiang RoadNo. nineteen, Lane one five zero, Furongjiang Road
id
  • Chinese
  • English
FormatExamplesChinese outputDescription
stringdell0101D E L L zero one zero oneUppercase and lowercase English letters, Arabic numerals 0~9, and underscores. The spaces in the output indicate a pause inserted between each character, that is, the characters are read one by one.
myid_1998M Y I D underscore one nine nine eight
AiTestA I T E S T
characters
  • Chinese
  • English
FormatExamplesChinese outputDescription
stringISBN 1-001-099098-1I S B N one dash zero zero one dash zero nine nine zero nine eight dash oneSupports Chinese characters, uppercase and lowercase English letters, Arabic numerals 0~9, and some full-width and half-width characters. The spaces in the output indicate a pause inserted between each character, that is, the characters are read one by one. If the text within the tag contains special XML characters, they must be escaped.
x10b2345_ux one zero b two three four five underscore u
v1.0.1v one point zero point one
Version number 2.0Version number two point zero
Su M MA000Su M M A zero zero zero
Airbus A330Airbus A three three zero
Model s01 s02 and s03Model s zero one s zero two and s zero three
Airbus A330Airbus A three three zero
αβγalpha beta gamma
punctuation
  • Chinese
  • English
FormatExamplesChinese outputDescription
Punctuation…ellipsisSupports common Chinese and English punctuation. The spaces in the output indicate a pause inserted between each character, that is, the characters are read one by one. If the text within the tag contains special XML characters, they must be escaped.
……ellipsis
!"#$%&exclamation mark double quote hash dollar percent and
‘()*+single quote left parenthesis right parenthesis asterisk plus
,-./:;comma dash dot slash colon semicolon
<=>?@less than equal sign greater than question mark at
[\]^_Left bracket backslash right bracket caret underscore
date
  • Chinese
  • English
FormatExamplesChinese outputDescription
year xxyear 71year 71 (in Chinese numerals)2-digit and 4-digit years are supported. Among them: 2-digit years support 60~99, 00~09, and 10~19. 4-digit years support 1000~1999 and 2000~2099.
year 04year 04 (in Chinese numerals)
year 19year 19 (in Chinese numerals)
year 1011year 1011 (in Chinese numerals)
year 1998year 1998 (in Chinese numerals)
year 2008year 2008 (in Chinese numerals)
year xx, month xxyear 98, month 4year 98, month 4 (in Chinese numerals)When the month is 1 to 9, both notations with and without a leading "0" are supported. For example, "year 1908, month 4" and "year 1908, month 04".
year 1998, month 04year 1998, month 4 (in Chinese numerals)
year 08, month 8year 08, month 8 (in Chinese numerals)
year 2008, month 8year 2008, month 8 (in Chinese numerals)
year xx, month xx, day xx; year xx, month xx, day xx (alternative day notation)year 98, month 4, day 23year 98, month 4, day 23 (in Chinese numerals)When the day is 1 to 9, both notations with and without a leading "0" are supported. For example, "year 1908, month 4, day 8" and "year 1908, month 04, day 08".
year 1998, month 04, day 23April 23, 1998
August 8, '08August 8, '08
August 8, 2008August 8, 2008
year xx, month xx, day xx; year xx, month xx, day xx (alternative day notation)year 98, month 4, day 23year 98, month 4, day 23 (in Chinese numerals)When the date is between the 1st and the 9th of the month, both spellings with and without a leading "0" are supported, for example "April 8, 1908" and "April 08, 1908".
year 1998, month 04, day 23April 23, 1998
August 8, '08August 8, '08
August 8, 2008August 8, 2008
MM/DDMarch 20March 20None
August 7August 7
Year and month abbreviation2018/08August 2018"/", "-", and "." are supported as separators for abbreviations.
2018-08August 2018
2018.08August 2018
Year, month, and day abbreviation2018/08/08August 8, 2018
2018-8-8August 8, 2018
2018.08.08August 8, 2018
MM/DD/YYYY~MM/DD/YYYY MM/DD/YYYY~MM/DD/YYYYSeptember 1~30, '04September 1 to 30, '04"~" and "-" are supported as abbreviation markers for "to".
September 1, 2004 - June 8, 2008September 1, 2004 to June 8, 2008
MM/DD/YYYY~DD MM/DD/YYYY~DDSeptember 1~30, '04September 1 to 30, '04
September 1, 2004 - June 8, 2008September 1, 2004 to June 8, 2008
MM/YYYY~MM/YYYYApril '01~April '10April '01 to April '10
April 2001~April 2010April 2001 to April 2010
MM/DD~MM/DD MM/DD~MM/DDOctober 1~October 7October 1 to October 7
October 01~October 07October 1~October 7
xx month xx day~xx day; xx month xx day~xx dayOctober 1~7October 1 to 7
October 01~07October 1st to 7th
Year-month-day abbreviation~year-month-day abbreviation2018/03/03~2019/01/01March 3, 2018 to January 1, 2019Supports "/" and "." as separators for abbreviations, and supports "~" and "-" as abbreviated markers for "to".
1997.9.9~1998.9.9September 9, 1997 to September 9, 1998
Month-day abbreviation~month-day abbreviation10/20~10/31October 20 to October 31
xx~xx month; xx month~xx month1~10 monthJanuary to October
January~OctoberJanuary to October
Month-day-year abbreviation10/20/2018October 20, 2018Only 4-digit years are supported, only "/" is supported as the date separator, and only the month/day/year writing format is supported.
time
  • Chinese
  • English
FormatExamplesChinese outputDescription
Time of day12:00Twelve o'clockSupports common time and time range formats.
12:00:00 o'clockTwelve o'clock
10:20Ten twenty
10:20:30Ten twenty and thirty seconds
09:18:14Nine eighteen and fourteen seconds
Time of day~Time of day11:00~12:00Eleven o'clock to twelve o'clock
09:00-14:00Nine o'clock to fourteen o'clock
11:00~11:30Eleven o'clock to eleven thirty
11:00-12:18Eleven o'clock to twelve eighteen
10:30~11:00Ten thirty to eleven o'clock
09:28-10:00Nine twenty-eight to ten o'clock
10:20~11:20Ten twenty to eleven twenty
06:00~08:00Six o'clock to eight o'clock
10:20 a.m.~13:30 p.m.Ten twenty a.m. to thirteen thirty p.m.
Time abbreviations5:00 amFive o'clock sharp in the early morning
5:30 amHalf past five in the early morning
5:20:12 amFive twenty and twelve seconds in the early morning
7:00 amSeven o'clock sharp in the morning
7:30 AM7:30 AM
7:20:12 a.m.7:20:12 AM
07:08:12 A.M.7:08:12 AM
5:00 pm5:00 PM
5:30 PM5:30 PM
5:20:12 p.m.5:20:12 PM
05:09:12 P.M.5:09:12 PM
9:00 pm9:00 PM
9:30 pm9:30 PM
9:20:12 PM9:20:12 PM
9:02:12 P.M.9:02:12 PM
12:00 pm12:00 PM
12:30 p.m.12:30 PM
12:20:12 PM12:20:12 PM
currency
  • Chinese
  • English
FormatExamplesChinese outputDescription
Number + currency identifier12.00 RMB12 RMBSupported currencies include AUD (Australian dollar), CAD (Canadian dollar), HKD (Hong Kong dollar), JPY (Japanese yen), USD (US 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 international notation separated by commas.
12.50 RMB12.50 RMB
12,000,000 RMB12,000,000 RMB
12,000,000.00 RMB12,000,000 RMB
12,000.35 RMB12,000.35 RMB
Currency identifier + number$1212 USDSupported: CAD (Canadian dollar), $ (US dollar), Fr (franc), kr (Danish krone), £ (British pound), ¥ (yuan), and € (euro). Supported number formats include: integers, decimals, and international notation separated by commas.
$12.0012 USD
$12.122.12 USD
$12,00012,000 USD
$12,000.0012,000 USD
$12,000.9912,000.99 USD
Other default readings1213one thousand two hundred and thirteenNone
1213 KMLone thousand two hundred and thirteen K M L
1213.00 KMLone thousand two hundred and thirteen K M L
1213.9 KMLone thousand two hundred and thirteen point nine K M L
1,000 KMLone thousand K M L
1,000.00 KMLone thousand K M L
1,000.98 KMLone thousand point nine eight K M L
12,000twelve thousand
measure
  • Chinese
  • English
FormatExamplesChinese outputDescription
Number + Chinese unit2 piecestwo piecesCommon Chinese units and unit abbreviations are supported.
120 hectaresone hundred and twenty hectares
more than 100 milligramsmore than one hundred milligrams
approximately 100 metersapproximately one hundred meters
over 100 peopleover one hundred people
1 centimeter 20 millimetersone centimeter twenty millimeters
120.00 square kilometersone hundred and twenty square kilometers
Number + unit abbreviation120.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 mmone hundred meters twelve centimeters six millimeters
Range10~15 kgten to fifteen kilograms
10.24~789.82 muten point two four to seven hundred eighty-nine point eight two mu
10 m~15 mten meters to fifteen meters
10.24 cm~19.08 cmten point two four centimeters to nineteen point zero eight centimeters
number + unit + "/" + unit10 CNY/jinten CNY per jin
199~299 CNY/pieceone hundred ninety-nine to two hundred ninety-nine CNY per piece
299.99 CNY/g~399.99 CNY/gtwo hundred ninety-nine point nine nine CNY per gram to three hundred ninety-nine point nine nine CNY per gram
Other default readings12 bundlestwelve bundles
30 rmthirty r m
four hundred million compatriotsfour hundred million compatriots
12.897 microgramstwelve point eight nine seven micrograms
Common symbols
SymbolChinese readingEnglish pronunciation
!Exclamation markexclamation mark
“Double quotedouble quote
#Hash signpound
$dollardollar
%Percent signpercent
&andand
‘Single quoteleft quote
(Left parenthesisleft parenthesis
)Right parenthesisright parenthesis
*Asteriskasterisk
+Plus signplus
,Commacomma
-Hyphendash
.Pointdot
/Slashslash
:Zero colonsolon
;Semicolonsemicolon
<Less thanless than
=Equals signequals
>Greater thangreater than
?Question markquestion mark
@atat
[Left square bracketleft bracket
\Backslashback slash
]Right square bracketright bracket
^Caretcaret
_Underscoreunderscore
`Backtickback quote
{Left curly braceleft brace
|VERTICAL LINEvertical bar
}Right curly braceright brace
~Tildetilde
!Exclamation markexclamation mark
“Left double quotation markleft double quote
”Right double quotation markright double qute
‘Left single quotation markleft quote
’Right single quotation markright quote
(Left parenthesisleft parenthesis
)Right parenthesisright parenthesis
,Commacomma
。Periodfull stop
—Hyphenem dash
:Coloncolon
;Semicolonsemicolon
?Question markquestion mark
、Enumeration commaenumeration comma
…ellipsisellipsis
……ellipsisellipsis
《Left title markleft guillemet
》Right title markright guillemet
¥RMB signyuan
≥Greater than or equal togreater than or equal to
≤Less than or equal toless than or equal to
≠Not equal tonot equal
≈Approximately equal toapproximately equal
±Plus-minusplus or minus
×Multiplication signtimes
πPipi
ΑAlphaalpha
ΒBetabeta
ΓGammagamma
ΔDeltadelta
ΕEpsilonepsilon
ΖZetazeta
ΘThetatheta
ΙIotaiota
ΚKappakappa
∧Lambdalambda
ΜMumu
ΝNunu
ΞXiksi
ΟOmicronomicron
∏Pipi
ΡRhorho
∑Sigmasigma
ΤTautau
ΥUpsilonupsilon
Φfaiphi
ΧChichi
ΨPsipsi
ΩOmegaomega
αAlphaalpha
βBetabeta
γGammagamma
δDeltadelta
εEpsilonepsilon
ζZetazeta
ηEtaeta
θThetatheta
ιIotaiota
κKappakappa
λLambdalambda
μMumu
νNunu
ξXiksi
οOmicronomicron
πPipi
ρRhorho
σSigmasigma
τTautau
υUpsilonupsilon
φfaiphi
χChichi
ψPsipsi
ωOmegaomega
Common measurement units
FormatCategoryChinese exampleEnglish example
AbbreviationLengthnm (nanometer), μm (micrometer), mm (millimeter), cm (centimeter), m (meter), km (kilometer), ft (foot), in (inch)nm (nanometre), μm (micrometre), mm (millimetre), cm (centimetre), m (metre), km (kilometre), ft (foot), in (inch)
Areacm² (square centimeter), ㎡ (square meter), km² (square kilometer), SqFt (square foot)cm² (square centimetre), ㎡ (square metre), km2 (square kilometre), SqFt (square foot)
Volumecm³ (cubic centimeter), m³ (cubic meter), km³ (cubic kilometer), mL (milliliter), L (liter), gallon (gallon)cm³ (cubic centimetre), m³ (cubic metre), km3 (cubic kilometre), mL (millilitre), L (millilitre), gal (gallon)
Weightμg (microgram), mg (milligram), g (gram), kg (kilogram)μg (microgram), mg (microgram), g (gram), kg (kilogram)
Timemin (minute), sec (second), ms (millisecond)min (minute), sec (second), ms (millisecond)
ElectromagnetismμA (microampere), mA (milliampere), Ω (ohm), Hz (hertz), kHz (kilohertz), MHz (megahertz), GHz (gigahertz), V (volt), kV (kilovolt), kWh (kilowatt-hour)μA (microamp), mA (milliamp), Hz (hertz), kHz (kilohertz), MHz (megahertz), GHz (gigahertz), V (volt), kV (kilovolt), kWh (kilowatt hour)
SounddB (decibel)dB (decibel)
Air pressurePa (pascal), kPa (kilopascal), Mpa (megapascal)Pa (pascal), kPa (kilopascal), MPa (megapascal)
Other common unitsIn addition to the categories listed above, Chinese units such as mi (meter), miao (second), meiyuan (US dollar), and haoshengmeiping (milliliter per bottle) are supported, as well as Chinese measure words such as jia (for aircraft), chang (for shows), tou (for animals), bu (for devices), and pen (for potted plants).Units of measurement beyond the above categories are also supported, such as tsp (teaspoon), rpm (round per minute), KB (kilobyte), and mmHg (milimetre of mercury).

LaTeX tags and symbols

View the supported tags and symbols by category. The formula input examples include delimiters; the reading column provides examples in Chinese.

Basic math

Tag or symbolMeaningFormula content exampleFormula input exampleExample reading
+Plus sign2 + 3 = 5$2 + 3 = 5$Two plus three equals five
-Minus3 - 2 = 1$3 - 2 = 1$Three minus two equals one
\pmPlus-minus\pm 1 \pm 2$\pm 1\pm 2$Plus or minus one, plus or minus two
Plus or minus
\timesMultiplication sign2 \times 3 = 6$2 \times 3 = 6$Two times three equals six
×2 × 3 = 6$$2 × 3 = 6$$
*2 * 3 = 6\(2 * 3 = 6\)
\divDivided by6\div2=3\[6\div2=3\]Six divided by two equals three
÷6÷2=3$6÷2=3$
/6/2=3$6/2=3$
=Equals3+5=8$3+5=8$Three plus five equals eight
<Less than1< 2$1< 2$One is less than two
≤Less than or equal to3≤5$3≤5$Three is less than or equal to five
<=3<=5$3<=5$
\leq3\leq5$3\leq 5$
\le3\le5$3\le 5$
\leqq3\leqq5$3\leqq 5$
\leqslant3\leqslant5$3\leqslant 5$
>Greater than2>1$2>1$Two is greater than one
≥Greater than or equal to5≥3$5≥3$Five is greater than or equal to three
>=5>=3$5>=3$
\geq5\geq3$5\geq 3$
\ge5\ge3$5\ge 3$
\geqq5\geqq3$5\geqq 3$
\geqslant5\geqslant3$5\geqslant 3$
\fracFraction2\frac3$\frac {2}{3}$Two thirds
^Power2^1$2^{1}$Two to the first power
\sqrtSquare root\sqrt{9} = 3$\sqrt {9} = 3$The square root of nine equals three
\sqrt[3]{8} = 2$\sqrt[3]{8} = 2$The cube root of eight equals two
\%Percentage5\%$5\%$Five percent
|Absolute value∣3∣=3$|3| =3$The absolute value of three equals three
\vert3\vert=3$\vert 3\vert =3$The absolute value of three, absolute value, equals three
\lgLogarithmlg {10}$\lg {10}$log ten
\logLogarithm\log{5}$\log{5}$log five
\lnNatural logarithm\lnX$ln {10}$LN ten
!Factorial5!$5!$The factorial of five
()Parentheses(2+1)$(2+1)$Two plus one inside the parentheses
\{ \}$\{2+1\}$Left curly brace, two plus one, right curly brace

Special mathematical symbols

Tag or symbolMeaningFormula content exampleFormula input exampleExample reading
\alphaalpha\alpha$\alpha$α
\Alpha\Alpha$\Alpha$
\betabeta\beta$\beta$β
\Beta\Beta$\Beta$
\gammagamma\gamma$\gamma$γ
\Gamma\Gamma$\Gamma$
\deltadelta\delta$\delta$Δ
\Delta\Delta$\Delta$
\inftyInfinity (Chinese)\infty$\infty$Infinity
∞infty (English)∞$∞$

Geometry

Tag or symbolMeaningFormula content exampleFormula input exampleExample reading
\piPi\pi=3.14159$\pi =3.14159$Pi equals three point one four one five nine
\sin (sine)Trigonometric functions\sin 30^\circ =\frac {1}{2}$\sin 30^\circ =\frac {1}{2}$The sine of thirty degrees equals one half
\cos (cosine)\cos 45^\circ =\frac {\sqrt {2}}{2}$\cos 45^\circ =\frac {\sqrt {2}}{2}$The cosine of forty-five degrees equals the square root of two over two
\tan (tangent)\tan 30^\circ =\frac {\sin 30^\circ}{\cos 30^\circ}$\tan 30^\circ =\frac {\sin 30^\circ}{\cos 30^\circ}$The tangent of thirty degrees equals the sine of thirty degrees over the cosine of thirty degrees
\csc (cosecant)\csc A$\csc A$cosecant A
\sec (secant)\sec A$\sec A$secant A
\cot (cotangent)\cot A$\cot A$cotangent A
\angleAngle\angle AB$\angle AB$Angle A B
∠∠AB$∠AB$
^\circDegree∠AB = 30^\circ$∠AB = 30^\circ$Angle A B equals thirty degrees
\odotCircle\odot$\odot$Circle
\overset\frownArc\overset\frown {BC}$\overset\frown {BC}$Arc BC
\rm{Rt}Right angle\because \rm{Rt}\triangle ABC$\because \rm{Rt}\triangle ABC$Because right triangle ABC
\mathrm{Rt}\therefore AB \perp BC$\therefore AB \perp BC$Therefore AB is perpendicular to BC
\triangleTriangle\triangleABC$\triangle ABC$Triangle ABC
△△ABC$△ABC$
\parallelogramParallelogram\parallelogramABCD$\parallelogram ABCD$Parallelogram ABCD
\perpPerpendicularAB \perp BC$AB \perp BC$A B is perpendicular to B C
\botAB \bot BC$AB \bot BC$
⊥AB ⊥ BC$AB ⊥ BC$
\parallelParallelA\parallel B$A\parallel B$A is parallel to B
\equalparallelParallel and equal toA\equalparallel B$A\equalparallel B$A is parallel and equal to B
\congCongruent△ABC\cong△DEF$△ABC\cong△DEF$Triangle ABC is congruent to triangle DEF

Conditions

Tag or symbolMeaningFormula content exampleFormula input exampleExample reading
\impliesImplies\implies 1+1=2$\implies 1+1=2$Implies that one plus one equals two
\iffEquivalentp\iffq$p\iffq$p is equivalent to q
\becauseBecause\because a = b \therefore b=a$\because a = b \therefore b=a$Because a equals b, so b equals a
\thereforeTherefore

Units

Units must be wrapped in \unit, \quantity, \mathit, \mathrm, or \rm, for example \unit{cm}.
Tag or symbolMeaningFormula content exampleFormula input exampleExample reading
mmmillimeter5\quantity{mm}$5\quantity{mm}$five millimeters
cmcentimeter5\quantity{cm}$5\quantity{cm}$five centimeters
dmdecimeter5\quantity{dm}$5\quantity{dm}$five decimeters
mmeter5\quantity{m}$5\quantity{m}$five meters
kmkilometer5\quantity{km}$5\quantity{km}$five kilometers
ggram5\quantity{g}$5\quantity{g}$five grams
kgkilogram5\quantity{kg}$5\quantity{kg}$five kilograms
tton5\quantity{t}$5\quantity{t}$five tons
mm^2square millimeter5\quantity{mm^2}$5\quantity{mm^2}$five square millimeters
cm^2square centimeter5\quantity{cm^2}$5\quantity{cm^2}$five square centimeters
dm^2square decimeter5\quantity{dm^2}$5\quantity{dm^2}$five square decimeters
m^2square meter5\quantity{m^2}$5\quantity{m^2}$five square meters
km^2square kilometer5\quantity{km^2}$5\quantity{km^2}$five square kilometers
mm^3cubic millimeter5\quantity{mm^3}$5\quantity{mm^3}$five cubic millimeters
cm^3cubic centimeter5\quantity{cm^3}$5\quantity{cm^3}$five cubic centimeters
dm^3cubic decimeter5\quantity{dm^3}$5\quantity{dm^3}$five cubic decimeters
m^3cubic meter5\quantity{m^3}$5\quantity{m^3}$five cubic meters
km^3cubic kilometer5\quantity{km^3}$5\quantity{km^3}$five cubic kilometers
mlmilliliter5\quantity{ml}$5\quantity{ml}$five milliliters
ssecond5\quantity{s}$5\quantity{s}$five seconds
minminute5\quantity{min}$5\quantity{min}$five minutes
hhour5\quantity{h}$5\quantity{h}$five hours
km/hkilometers per hour5\quantity{km/h}$5\quantity{km/h}$five kilometers per hour
g/lgrams per liter5\quantity{g/l}$5\quantity{g/l}$five grams per liter

FAQ

What should I do if formulas are not read aloud correctly?

  1. Check whether the formula is wrapped in $...$, $$...$$, \(...\), or \[...\].
  2. Check whether the formula contains unsupported tags or symbols.
  3. Check whether the \ in the request string is correctly escaped as \\.

How do I handle backslashes in code?

For escaping instructions, see Usage. Formulas are written differently from code strings. For example, \frac should be written as \\frac in a regular string.