This skill uses the Volcano Engine Doubao speech synthesis large model'sone-way streaming HTTP V3 interfaceto synthesize text into speech audio files.
Official documentation:Doubao Speech Synthesis API documentation
Prerequisites
The user needs to provide the following environment variables (set via export or passed in as script parameters):
DOUBAO_APP_ID: the APP ID obtained from the Volcano Engine consoleDOUBAO_ACCESS_KEY: the Access Token obtained from the Volcano Engine consoleDOUBAO_SPEAKER: timbre ID (optional, defaults tozh_female_xiaohe_uranus_bigtts)- Voice clone timbres start with
S_and can be created in the official backend:Timbre Clone Console - See the timbre comparison table below for official preset timbres
- Voice clone timbres start with
If the user has not set DOUBAO_APP_ID and DOUBAO_ACCESS_KEY,first remind the user to set them, and tell them how to obtain them: log in to the Volcano Engine console → Doubao Voice → create an application → obtain the APP ID and Access Token.
If the user has not set DOUBAO_SPEAKER, use zh_female_xiaohe_uranus_bigttsby default (Xiaohe 2.0, general Chinese female voice).
Usage flow
1. Confirm parameters
Confirm the following information with the user (items with reasonable defaults can skip confirmation):
| Parameter | Description | Default value |
|---|---|---|
| Text to synthesize | The text content to convert to speech | (required) |
| Timbre ID (speaker) | Timbre identifier. Voice clone timbres start with S_ ; select an appropriate timbre from the timbre table below according to the context |
$DOUBAO_SPEAKER or zh_female_xiaohe_uranus_bigtts |
| Resource ID (resource_id) | For voice clone use seed-icl-1.0; for official 1.0 timbres use seed-tts-1.0; for official 2.0 timbres use seed-tts-2.0 |
seed-tts-2.0 |
| Audio format (format) | mp3 / ogg_opus / pcm |
mp3 |
| Sample rate (sample_rate) | Options: 8000/16000/22050/24000/32000/44100/48000 | 24000 |
| Emotion (emotion) | Emotion type, supported only by multi-emotion timbres. Chinese timbres:happy / sad / angry / surprised / fear / hate / excited / coldness / neutral , etc.; English timbres:neutral / happy / angry / sad / excited / chat / warm , etc. |
Not set |
| Emotion intensity (emotion_scale) | Range 1~5; the larger the value, the more obvious the emotion (non-linear); must be used together with emotion Use |
4 |
| Output file name | File name of the generated audio | output.mp3 |
2. Execute synthesis
Run the script:
# 基础用法(resource-id 自动推断)
python3 /path/to/doubao-tts/scripts/tts_synthesize.py \
--text "要合成的文本" \
--speaker "${DOUBAO_SPEAKER:-zh_female_xiaohe_uranus_bigtts}" \
--format mp3 \
--sample-rate 24000 \
--output /mnt/user-data/outputs/output.mp3
# 带情感的合成(仅多情感音色支持)
python3 /path/to/doubao-tts/scripts/tts_synthesize.py \
--text "要合成的文本" \
--speaker "zh_female_shuangkuaisisi_emo_v2_mars_bigtts" \
--emotion happy \
--emotion-scale 4 \
--output /mnt/user-data/outputs/output.mp3
Environment variables DOUBAO_APP_ID and DOUBAO_ACCESS_KEY must already be set. They can also be passed directly via the --app-id and --access-key parameters.
3. Output result
The script saves the synthesized audio to the specified path. After synthesis is complete, use the present_files tool to present the file to the user.
Voice Comparison Table
The Agent should select the most appropriate voice ID from the table below based on the context (the role, scenario, and style requested by the user).
For the complete voice list, see the official documentation:Voice List
Doubao Speech Synthesis 2.0 voices (recommended, resource_id uses seed-tts-2.0)
| Scenario | Voice Name | voice_type (Voice ID) | Language | Applicable Role/Description |
|---|---|---|---|---|
| General | Xiaohe 2.0 ⭐Default | zh_female_xiaohe_uranus_bigtts |
Chinese | General female voice, natural and friendly |
| General | Vivi 2.0 | zh_female_vv_uranus_bigtts |
Chinese/Japanese/Indonesian/Spanish | Multilingual female voice, emotionally expressive |
| General | Yunzhou 2.0 | zh_male_m191_uranus_bigtts |
Chinese | General male voice |
| General | Xiaotian 2.0 | zh_male_taocheng_uranus_bigtts |
Chinese | General male voice, young |
| General | Liu Fei 2.0 | zh_male_liufei_uranus_bigtts |
Chinese | General male voice |
| General | Charming Sophie 2.0 | zh_male_sophie_uranus_bigtts |
Chinese | General male voice |
| General | Fresh Female Voice 2.0 | zh_female_qingxinnvsheng_uranus_bigtts |
Chinese | Fresh and elegant female voice |
| General | Sweet Xiaoyuan 2.0 | zh_female_tianmeixiaoyuan_uranus_bigtts |
Chinese | Sweet female voice |
| General | Sweet Taozi 2.0 | zh_female_tianmeitaozi_uranus_bigtts |
Chinese | Sweet female voice |
| General | Cheerful Sisi 2.0 | zh_female_shuangkuaisisi_uranus_bigtts |
Chinese | Cheerful and lively female voice |
| General | Girl Next Door 2.0 | zh_female_linjianvhai_uranus_bigtts |
Chinese | Friendly girl-next-door style female voice |
| General | Youthful Zixin 2.0 | zh_male_shaonianzixin_uranus_bigtts |
Chinese | Youthful male voice |
| General | Charming Girlfriend 2.0 | zh_female_meilinvyou_uranus_bigtts |
Chinese | Charming mature female voice |
| General | Fluent Female Voice 2.0 | zh_female_liuchangnv_uranus_bigtts |
Chinese | Fluent and natural female voice, suitable for reading long texts aloud |
| General | Refined Yichen 2.0 | zh_male_ruyayichen_uranus_bigtts |
Chinese | Refined and mature male voice |
| Role-play | Intellectual Cancan 2.0 | zh_female_cancan_uranus_bigtts |
Chinese | Intellectual and capable female voice |
| Role-play | Coy Junior Schoolgirl 2.0 | zh_female_sajiaoxuemei_uranus_bigtts |
Chinese | Coy and cute female voice |
| Video Dubbing | Monkey King 2.0 | zh_male_sunwukong_uranus_bigtts |
Chinese | Sun Wukong character, heroic |
| Video Dubbing | Peppa Pig 2.0 | zh_female_peiqi_uranus_bigtts |
Chinese | Cartoon child character |
| Video Dubbing | Dayi 2.0 | zh_male_dayi_uranus_bigtts |
Chinese | Video dubbing male voice |
| Video dubbing | Black Cat Detective Agency Mizai 2.0 | zh_female_mizai_uranus_bigtts |
Chinese | Cute cartoon female voice |
| Video dubbing | Chicken Soup Female 2.0 | zh_female_jitangnv_uranus_bigtts |
Chinese | Warm inspirational female voice |
| Education scenario | Teacher Tina 2.0 | zh_female_yingyujiaoxue_uranus_bigtts |
Chinese/British English | Teacher/education scenario |
| Customer service scenario | Warm Sun Female Voice 2.0 | zh_female_kefunvsheng_uranus_bigtts |
Chinese | Dedicated for customer service, warm and professional |
| Audiobook reading | Children's Picture Book 2.0 | zh_female_xiaoxue_uranus_bigtts |
Chinese | Children's stories, picture book reading |
| Multilingual | Tim | en_male_tim_uranus_bigtts |
American English | English male voice |
| Multilingual | Dacey | en_female_dacey_uranus_bigtts |
American English | English female voice |
| Multilingual | Stokie | en_female_stokie_uranus_bigtts |
American English | English female voice |
Doubao Speech Synthesis 1.0 voices (resource_id uses seed-tts-1.0)
General scenario
| Scenario | Voice name | voice_type (voice ID) | Language | Applicable role/description |
|---|---|---|---|---|
| General | Cancan/Shiny | zh_female_cancan_mars_bigtts |
Chinese/American English | Lively and cheerful female voice |
| General | Vivi | zh_female_vv_mars_bigtts |
Chinese | Standard female voice |
| General | Straightforward Sisi/Skye | zh_female_shuangkuaisisi_moon_bigtts |
Chinese/American English | Bright and lively female voice |
| General | Warm Ahu/Alvin | zh_male_wennuanahu_moon_bigtts |
Chinese/American English | Warm and friendly male voice |
| General | Youth Zixin/Brayan | zh_male_shaonianzixin_moon_bigtts |
Chinese/American English | Youthful boy voice |
| General | Fresh female voice | zh_female_qingxinnvsheng_mars_bigtts |
Chinese | Fresh and elegant |
| General | Intellectual female voice | zh_female_zhixingnvsheng_mars_bigtts |
Chinese | Intellectual and mature female voice |
| General | Refreshing male college student | zh_male_qingshuangnanda_mars_bigtts |
Chinese | Refreshing male college student voice |
| General | Girl next door | zh_female_linjianvhai_moon_bigtts |
Chinese | Friendly girl-next-door style |
| General | Erudite uncle | zh_male_yuanboxiaoshu_moon_bigtts |
Chinese | Knowledgeable uncle feel |
| General | Sunny youth | zh_male_yangguangqingnian_moon_bigtts |
Chinese | Positive and sunny male voice |
| General | Sweet Xiaoyuan | zh_female_tianmeixiaoyuan_moon_bigtts |
Chinese | Sweet female voice |
| General | Sweet Yueyue | zh_female_tianmeiyueyue_moon_bigtts |
Chinese | Sweet female voice |
| General | Clear Zizi | zh_female_qingchezizi_moon_bigtts |
Chinese | Clear and clean female voice |
| General | Cheerful Sister | zh_female_kailangjiejie_moon_bigtts |
Chinese | Cheerful Big Sister |
| General | Boy Next Door | zh_male_linjiananhai_moon_bigtts |
Chinese | Friendly Boy-Next-Door Male Voice |
| General | Inspirational Chicken Soup | zh_female_xinlingjitang_moon_bigtts |
Chinese | Warm and Inspirational Female Voice |
| General | Happy Xiaodong | zh_male_xudong_conversation_wvae_bigtts |
Chinese | Male Voice for Dialogue Scenarios |
| General | Friendly Female Voice | zh_female_qinqienvsheng_moon_bigtts |
Chinese | Friendly and Gentle Female Voice |
| Education | Teacher Tina | zh_female_yingyujiaoyu_mars_bigtts |
Chinese/British English | Teaching Scenario |
Multi-emotion Voices (support emotion parameter)
| Voice Name | voice_type (Voice ID) | Supported Emotions | Applicable Scenarios |
|---|---|---|---|
| Frank Sisi (Multi-emotion) | zh_female_shuangkuaisisi_emo_v2_mars_bigtts |
Happy/Sad/Angry/Surprised/Excited/Indifferent/Neutral | Emotionally rich dialogue, stories |
| Gentle Girlfriend (Multi-emotion) | zh_female_roumeinvyou_emo_v2_mars_bigtts |
Happy/Sad/Angry/Surprised/Fear/Disgust/Excited/Indifferent/Neutral | Emotionally rich female voice |
| Aloof Queen (Multi-emotion) | zh_female_gaolengyujie_emo_v2_mars_bigtts |
Happy/Sad/Angry/Surprised/Fear/Disgust/Excited/Indifferent/Neutral | Queen/Aloof female character |
| Cold Older Brother (Multi-emotion) | zh_male_lengkugege_emo_v2_mars_bigtts |
Angry/Indifferent/Fear/Happy/Disgust/Neutral/Sad/Depressed | Cold/Aloof male character |
| Tsundere CEO (Multi-emotion) | zh_male_aojiaobazong_emo_v2_mars_bigtts |
Neutral/Happy/Angry/Disgust | Domineering CEO, assertive male |
| Refined Boyfriend (Multi-emotion) | zh_male_ruyayichen_emo_v2_mars_bigtts |
Happy/Sad/Angry/Fear/Excited/Indifferent/Neutral | Gentle and refined boyfriend |
| Handsome Boyfriend (Multi-emotion) | zh_male_junlangnanyou_emo_v2_mars_bigtts |
Happy/Sad/Angry/Surprised/Fear/Neutral | Handsome boyfriend |
| Sunny Youth (Multi-emotion) | zh_male_yangguangqingnian_emo_v2_mars_bigtts |
Happy/Sad/Angry/Fear/Excited/Indifferent/Neutral | Sunny and positive youth |
| Gentle Young Master (Multi-emotion) | zh_male_yourougongzi_emo_v2_mars_bigtts |
Happy/Angry/Fear/Disgust/Excited/Neutral/Depressed | Gentle and elegant male |
| Beijing Young Master (Multi-emotion) | zh_male_beijingxiaoye_emo_v2_mars_bigtts |
Angry/Surprised/Fear/Excited/Indifferent/Neutral | Beijing accent male voice |
| Guangzhou De Ge (Multi-emotion) | zh_male_guangzhoudege_emo_mars_bigtts |
Angry/Fear/Neutral | Guangzhou dialect male voice |
| Beijing Chatterbox (Multi-emotion) | zh_male_jingqiangkanye_emo_mars_bigtts |
Happy/Angry/Surprised/Disgust/Neutral | Beijing Chatterbox style |
| Sweetie Xiaomei (Multi-emotion) | zh_female_tianxinxiaomei_emo_v2_mars_bigtts |
Sad/Fear/Disgust/Neutral | Sweet female voice |
| Neighbor Auntie (Multi-emotion) | zh_female_linjuayi_emo_v2_mars_bigtts |
Neutral/Angry/Indifferent/Depressed/Surprised | Middle-aged woman |
| Late-Night Podcast (Multi-emotion) | zh_male_shenyeboke_emo_v2_mars_bigtts |
Surprised/Sad/Neutral/Disgust/Happy/Fear/Excited/Depressed/Indifferent/Angry | Late-night podcast/radio |
| Candice | en_female_candice_emo_v2_mars_bigtts |
Deep affection/Angry/ASMR/Conversational/Excited/Cheerful/Neutral/Warm | English female voice |
| Serena | en_female_skye_emo_v2_mars_bigtts |
Deep affection/Angry/ASMR/Conversational/Excited/Cheerful/Neutral/Sad/Warm | English female voice |
| Glen | en_male_glen_emo_v2_mars_bigtts |
Deep affection/Angry/ASMR/Conversational/Excited/Cheerful/Neutral/Sad/Warm | English male voice |
| Sylus | en_male_sylus_emo_v2_mars_bigtts |
Deep affection/Angry/ASMR/Authoritative/Conversational/Excited/Cheerful/Neutral/Sad/Warm | English male voice |
| Corey | en_male_corey_emo_v2_mars_bigtts |
Angry/ASMR/Authoritative/Conversational/Deep affection/Excited/Cheerful/Neutral/Sad/Warm | British English male voice |
| Nadia | en_female_nadia_tips_emo_v2_mars_bigtts |
Deep affection/Angry/ASMR/Conversational/Excited/Cheerful/Neutral/Sad/Warm | British English female voice |
Fun accents
| Voice name | voice_type (voice ID) | Accent/Language | Description |
|---|---|---|---|
| Taiwan Xiao He | zh_female_wanwanxiaohe_moon_bigtts |
Taiwan Mandarin | Taiwan-accented female voice |
| Beijing Chatty Guy/Harmony | zh_male_jingqiangkanye_moon_bigtts |
Beijing accent | Beijing-accented chatty guy |
| Beijing Young Master | zh_male_beijingxiaoye_moon_bigtts |
Beijing accent | Beijing-accented male voice |
| Adorable Sichuan Girl | zh_female_daimengchuanmei_moon_bigtts |
Sichuan accent | Sichuan-flavored female voice |
| Yuzhou Zixuan | zh_male_yuzhouzixuan_moon_bigtts |
Henan accent | Henan-accented male voice |
| Guangxi Yuanzhou | zh_male_guangxiyuanzhou_moon_bigtts |
Guangxi accent | Guangxi-accented male voice |
| Guangzhou De Ge | zh_male_guozhoudege_moon_bigtts |
Guangdong accent | Guangdong-accented male voice |
| Bay Area Uncle | zh_female_wanqudashu_moon_bigtts |
Guangdong accent | Guangdong accent |
| Haoyu Xiao Ge | zh_male_haoyuxiaoge_moon_bigtts |
Qingdao accent | Qingdao-accented male voice |
| Meituo Jie'er | zh_female_meituojieer_moon_bigtts |
Changsha accent | Changsha-accented female voice |
| Cantonese Xiao Tang | zh_female_yueyunv_mars_bigtts |
Cantonese | Cantonese female voice |
Role-play
| Voice name | voice_type (voice ID) | Role characteristics |
|---|---|---|
| Cute Milky Kid | zh_male_naiqimengwa_mars_bigtts |
Cute kid, child role |
| Grandma | zh_female_popo_mars_bigtts |
Elderly female, grandmother |
| Aloof Queen | zh_female_gaolengyujie_moon_bigtts |
Aloof queen style |
| Tsundere CEO | zh_male_aojiaobazong_moon_bigtts |
Domineering CEO, tsundere male |
| Charming Girlfriend | zh_female_meilinvyou_moon_bigtts |
Charming girlfriend |
| Gentle Girlfriend | zh_female_sajiaonvyou_moon_bigtts |
Gentle, clingy girlfriend |
| Clingy Junior Girl | zh_female_yuanqinvyou_moon_bigtts |
Clingy, cute junior girl |
| Dongfang Haoran | zh_male_dongfanghaoran_moon_bigtts |
Righteous male lead |
| Late-Night Podcast | zh_male_shenyeboke_moon_bigtts |
Late-night radio host |
IP voice imitation
| Voice name | voice_type (voice ID) | Character/Prototype |
|---|---|---|
| Zhu Bajie | zh_male_zhubajie_mars_bigtts |
Zhu Bajie from Journey to the West |
| Tang Seng | zh_male_tangseng_mars_bigtts |
Tang Seng from Journey to the West |
| Luban No. 7 | zh_male_lubanqihao_mars_bigtts |
Luban No. 7 from Honor of Kings |
| Kasukabe Sister | zh_female_jiyejizi2_mars_bigtts |
Doraemon character |
| Female Thor | zh_female_leidian_mars_bigtts |
Thor character |
| Zhuang Zhou | zh_male_zhuangzhou_mars_bigtts |
Honor of Kings Zhuang Zhou |
Agent Voice Selection Guide
Intelligently select a voice based on context:
| Use Case | Recommended Voice | Voice ID |
|---|---|---|
| Default/General | Xiaohe 2.0 | zh_female_xiaohe_uranus_bigtts |
| Formal/News Broadcasting | Intellectual Female Voice | zh_female_zhixingnvsheng_mars_bigtts |
| Children's Stories/Picture Books | Children's Picture Book 2.0 | zh_female_xiaoxue_uranus_bigtts |
| English Content | Dacey | en_female_dacey_uranus_bigtts |
| Late Night/Radio/Podcast | Late Night Podcast (Multi-Emotion) | zh_male_shenyeboke_emo_v2_mars_bigtts |
| Audiobooks/Long-form Reading | Fluent Female Voice 2.0 | zh_female_liuchangnv_uranus_bigtts |
| Customer Service/Assistant | Warm Sun Female Voice 2.0 | zh_female_kefunvsheng_uranus_bigtts |
| Education/Teaching | Teacher Tina 2.0 | zh_female_yingyujiaoxue_uranus_bigtts |
| Taiwanese Accent | Wanwan Xiaohe | zh_female_wanwanxiaohe_moon_bigtts |
| Beijing Accent | Jingqiang Kanye | zh_male_jingqiangkanye_moon_bigtts |
| Ancient Style/Wuxia Characters | Dongfang Haoran | zh_male_dongfanghaoran_moon_bigtts |
| Domineering CEO | Tsundere CEO | zh_male_aojiaobazong_moon_bigtts |
| Cute Child | Baby-voiced Child | zh_male_naiqimengwa_mars_bigtts |
| Emotional Dialogue | Cheerful Sisi (Multi-Emotion) | zh_female_shuangkuaisisi_emo_v2_mars_bigtts |
| User-defined Custom Cloned Voice | User-provided S_ voice | S_xxxxxxxx(User voice clone ID) |
Important Notes
- Voice clone voices(starting with S_) must use
seed-icl-1.0as the resource_id, and cannot useseed-tts-1.0orseed-tts-2.0 - 2.0 voices(uranus series) must use
seed-tts-2.0, and do not support the legacy V1 interface - 1.0 voices(mars/moon series) use
seed-tts-1.0 - If the text provided by the user is very long (over 5000 characters), it is recommended to synthesize it in segments and then concatenate
- The script uses
requests.Sessionto implement connection reuse, in line with official best practices - The audio data returned by the streaming interface is base64-encoded, and the script will automatically decode and concatenate it
- If the user requests adjustments to speech rate, volume, pitch, etc., the corresponding parameters can be passed in
Error Handling
40402003: The text is too long and needs to be segmented40000001: Parameter error; check whether the voice ID and resource_id match40300001: Authentication failed; check the APP ID and Access Key- If a quota-related error occurs: the trial version usage has been exhausted, and the official version needs to be activated