SuperAPI AI Directory

doubao-open-tts

General & other

View repository

Updated 10-16 09:59

About this skill

Doubao Open TTS

Text-to-Speech (TTS) service using Doubao (Volcano Engine) API V1 interface to convert text into natural-sounding speech.

Features

  • 🎙️ 200+ Voice Options - Default: Shiny (Cancan) for general scenarios
  • 🔊 Multiple Audio Formats - Supports mp3, pcm, wav
  • ⚡ Adjustable Parameters - Speed and volume control
  • 📦 Dual Interface - Command-line tool + Python API
  • 🎯 Voice Categorization - Browse voices by category

Installation

cd skills/doubao-open-tts
pip install -r requirements.txt

Configuration

Method 1: Environment Variables

export VOLCANO_TTS_APPID="your_app_id"
export VOLCANO_TTS_ACCESS_TOKEN="your_access_token"
export VOLCANO_TTS_SECRET_KEY="your_secret_key"
export VOLCANO_TTS_VOICE_TYPE="zh_female_cancan_mars_bigtts"  # Optional: set default voice

Method 2: .env File

Copy .env.example.txt to .env and fill in your credentials:

cp .env.example.txt .env
# Edit the .env file with your credentials

Usage

Command Line

# Basic usage (uses default voice: Shiny)
python scripts/tts.py "Hello, this is a test of Doubao text-to-speech service"

# Specify output file and format
python scripts/tts.py "Welcome to use TTS" -o output.mp3 -e mp3

# Read text from file
python scripts/tts.py -f input.txt -o output.mp3

# Adjust parameters
python scripts/tts.py "Custom voice" --speed 1.2 --volume 0.8 -v zh_female_cancan_mars_bigtts

# List all available voices
python scripts/tts.py --list-voices

# List voices by category
python scripts/tts.py --list-voices --category "General-Multilingual"

# Use different cluster
python scripts/tts.py "Hello" --cluster volcano_tts

# Enable debug mode
python scripts/tts.py "Test" --debug

Python API

from scripts.tts import VolcanoTTS, VOICE_TYPES, VOICE_CATEGORIES

# Initialize client
tts = VolcanoTTS(
    app_id="your_app_id",
    access_token="your_access_token",
    secret_key="your_secret_key",
    voice_type="zh_female_cancan_mars_bigtts"  # Optional: set default voice
)

# List available voices
print("All voices:", tts.list_voices())
print("General voices:", tts.list_voices("General-Normal"))

# Change voice
tts.set_voice("zh_male_xudong_conversation_wvae_bigtts")  # Set to "Happy Xiaodong"

# Synthesize speech
output_path = tts.synthesize(
    text="Hello, this is Doubao text-to-speech",
    voice_type="zh_female_cancan_mars_bigtts",  # Optional: override default
    encoding="mp3",
    cluster="volcano_tts",
    speed=1.0,
    volume=1.0,
    output_file="output.mp3"
)
print(f"Audio saved to: {output_path}")

Available Voice Types

General Category (general-purpose scenarios)

Voice Name Voice Type Description
Shiny (Cancan) zh_female_cancan_mars_bigtts Cheerful female voice, suitable for various scenarios
Lively Xiaoning zh_female_wanwanxiaohe_mars_bigtts Lively and playful female voice
Xiaomo zh_male_xiaomo_mars_bigtts Warm and friendly male voice
Xiaoqi zh_female_xiaoqi_mars_bigtts Professional female host
AISuper (AI Super Fluent) zh_female_gaolanfenqu_mars_bigtts Super fluent female voice

Emotional Category (ultra-natural emotional voices)

Voice Name Voice Type Description
Happy Xiaodong zh_male_xudong_conversation_wvae_bigtts Cheerful and sunny male voice
Sad Xiaoliang zh_male_sadxiaoliang_sad_mars_bigtts Melancholic male voice
Neutral Xiaoshuai zh_male_zhongxingxiaoshuai_speech_mars_bigtts Neutral tone male voice
Happy Xiaomei zh_female_gaoxiaomei_happy_mars_bigtts Cheerful female voice
Angry Xiaotian zh_female_shengmoxiaotian_angry_mars_bigtts Angry tone female voice

Intelligent Customer Service

Voice Name Voice Type Description
Customer Service Xiaowen zh_male_jingyixiaowen_mars_bigtts Professional customer service male voice
Customer Service Xiaorou zh_female_xiaorou_customer_service_mars_bigtts Gentle customer service female voice

Documentary

Voice Name Voice Type Description
Classic Xiaoming zh_male_jingdianxiaoming_mars_bigtts Classic documentary male voice
Narration Xiaoran zh_female_xiaoran_narration_mars_bigtts Documentary narration female voice

Audio Novels

Voice Name Voice Type Description
Storytelling Xiaotao zh_female_jiangshuxiaotao_mars_bigtts Storytelling female voice
Warm Xiaochen zh_male_wennuanxiaochen_mars_bigtts Warm novel reading male voice

News Broadcasting

Voice Name Voice Type Description
News Xiaozhi zh_male_xinwenxiaozhi_mars_bigtts Standard news broadcasting male voice
News Xiaojing zh_female_xinwenxiaojing_mars_bigtts Professional news broadcasting female voice
Cantonese News zh_male_yueyuxiaowu_mars_bigtts Cantonese news male voice
Amoy News (Southern Min news) zh_female_minnanxiaoyue_mars_bigtts Amoy dialect news female voice

General-Multilingual

Voice Name Voice Type Description
English Gentle (gentle male English voice) en_male_mars_bigtts Gentle English male voice
English Lively (lively female English voice) en_female_mars_bigtts Lively English female voice
Japanese Male ja_male_mars_bigtts Japanese male voice
Japanese Female ja_female_mars_bigtts Japanese female voice
Korean Male ko_male_mars_bigtts Korean male voice
Korean Female ko_female_mars_bigtts Korean female voice
French Male fr_male_mars_bigtts French male voice
French Female fr_female_mars_bigtts French female voice
German Male de_male_mars_bigtts German male voice
German Female de_female_mars_bigtts German female voice
Spanish Male es_male_mars_bigtts Spanish male voice
Spanish Female es_female_mars_bigtts Spanish female voice
Russian Male ru_male_mars_bigtts Russian male voice
Russian Female ru_female_mars_bigtts Russian female voice
Portuguese Male pt_male_mars_bigtts Portuguese male voice
Portuguese Female pt_female_mars_bigtts Portuguese female voice
Italian Male it_male_mars_bigtts Italian male voice
Italian Female it_female_mars_bigtts Italian female voice
Arabic Male ar_male_mars_bigtts Arabic male voice
Arabic Female ar_female_mars_bigtts Arabic female voice
Hindi Male hi_male_mars_bigtts Hindi male voice
Hindi Female hi_female_mars_bigtts Hindi female voice
Thai Male th_male_mars_bigtts Thai male voice
Thai Female th_female_mars_bigtts Thai female voice
Vietnamese Male vi_male_mars_bigtts Vietnamese male voice
Vietnamese Female vi_female_mars_bigtts Vietnamese female voice
Indonesian Male id_male_mars_bigtts Indonesian male voice
Indonesian Female id_female_mars_bigtts Indonesian female voice
Malay Male ms_male_mars_bigtts Malay male voice
Malay Female ms_female_mars_bigtts Malay female voice
Filipino Male fil_male_mars_bigtts Filipino male voice
Filipino Female fil_female_mars_bigtts Filipino female voice
Turkish Male tr_male_mars_bigtts Turkish male voice
Turkish Female tr_female_mars_bigtts Turkish female voice
Dutch Male nl_male_mars_bigtts Dutch male voice
Dutch Female nl_female_mars_bigtts Dutch female voice
Polish Male pl_male_mars_bigtts Polish male voice
Polish Female pl_female_mars_bigtts Polish female voice
Ukrainian Male uk_male_mars_bigtts Ukrainian male voice
Ukrainian Female uk_female_mars_bigtts Ukrainian female voice
Hebrew Male he_male_mars_bigtts Hebrew male voice
Hebrew Female he_female_mars_bigtts Hebrew female voice

Dialect Category (dialect scenarios)

Voice Name Voice Type Description
Cantonese Male zh_male_yueyuzhongxing_mars_bigtts Cantonese male voice
Cantonese Female zh_female_yueyumars_mars_bigtts Cantonese female voice
Amoy Male (Southern Min male voice) zh_male_taiminmars_mars_bigtts Amoy dialect male voice
Amoy Female (Southern Min female voice) zh_female_minnanAImars_mars_bigtts Amoy dialect female voice
Sichuanese zh_male_sichuanmars_mars_bigtts Sichuan dialect male voice
Shanghainese zh_female_shanghaihuamars_mars_bigtts Shanghainese female voice
Wuhan Dialect zh_male_wuhanmars_mars_bigtts Wuhan dialect male voice
Hunan Dialect zh_male_hunanmars_mars_bigtts Hunan dialect male voice
Henan Dialect zh_female_henanmars_mars_bigtts Henan dialect female voice
Northeastern Dialect zh_male_dongbeimars_mars_bigtts Northeastern dialect male voice
Shandong Dialect zh_male_shandongmars_mars_bigtts Shandong dialect male voice
Tianjin Dialect zh_female_tianjinmars_mars_bigtts Tianjin dialect female voice

Special Categories

Voice Name Voice Type Description
Audiobook Xiaoyu zh_female_xiaoyujingxisanguo_mars_bigtts Three Kingdoms audiobook voice
Animation Xiaohua zh_female_xiaohuadongman_mars_bigtts Anime style voice
Rap Xiaoqiang zh_female_xiaoqiangrap_mars_bigtts Rap style female voice
RAP General (Rap Dajiang) zh_male_rapgeneral_mars_bigtts Rap style male voice
Wise Voice zh_male_jinyumars_mars_bigtts Wise and mature voice
Chattering zh_female_laolaodaodao_chat_mars_bigtts Chatty female voice
Talking Beijing zh_male_jianghuabeijing_speech_mars_bigtts Beijing accent
Host Xiaoyang zh_female_xiaoyang_host_mars_bigtts Streamer host style

Output

The generated audio file will be saved to the specified output path (default: output.mp3 in current directory).

Notes

  1. Ensure VOLCANO_TTS_APPID, VOLCANO_TTS_ACCESS_TOKEN, and VOLCANO_TTS_SECRET_KEY environment variables are set
  2. Supports mp3, pcm, and wav formats (mp3 by default)
  3. Speed range: 0.8-2.0 (1.0 is normal)
  4. Volume range: 0.1-3.0 (1.0 is normal)
  5. Voice types can be viewed using --list-voices
  6. Different clusters may support different voice types; default cluster is volcano_tts
  7. For non-Chinese text, use multilingual voices from "General-Multilingual" category