语音合成
- Base URL:
https://stardust.ticos.cn - 合成音频:
POST /tts - 查询音色:
GET /tts
1. 合成音频(POST /tts)
Section titled “1. 合成音频(POST /tts)”Content-Type: application/json
text(必填):要合成的文本voice(可选):音色标识符volume_ratio(可选):音量比例(默认50)speed_ratio(可选):语速比例(默认50)pitch_ratio(可选):音调比例(默认50)
{ "voice": "zh_male_jingqiangkanye_moon_bigtts", "text": "你好,这是一个例子文本。", "volume_ratio": 50, "speed_ratio": 50, "pitch_ratio": 50}200 OKContent-Type: audio/wav- 返回 WAV 音频字节流
400 Bad Request:缺少必填参数或 JSON 非法500 Internal Server Error:服务器内部错误
Curl 示例
Section titled “Curl 示例”curl --location 'https://stardust.ticos.cn/tts' \--header 'Content-Type: application/json' \--data-raw '{ "voice": "zh_male_jingqiangkanye_moon_bigtts", "text": "你好,这是一个例子文本。", "volume_ratio": 50, "speed_ratio": 50, "pitch_ratio": 50}'2. 查询可用音色(GET /tts)
Section titled “2. 查询可用音色(GET /tts)”常用查询参数
Section titled “常用查询参数”language:如chinese、englishgender:male/femalename:按名称模糊匹配provider:如baidu、bytedance、aliyuntags:按标签过滤,可用逗号分隔多个标签all:true返回完整字段,默认falseskip:分页偏移(默认0)top:返回条数(默认10)
{ "code": 0, "message": "Success", "data": { "speakers": [ { "name": "音色名称", "voice": "音色标识符" } ], "speakers_count": 10, "total_speakers_count": 500 }}Curl 示例
Section titled “Curl 示例”# 前 5 个中文音色curl "https://stardust.ticos.cn/tts?language=chinese&skip=0&top=5"
# 所有男性音色(完整字段)curl "https://stardust.ticos.cn/tts?gender=male&all=true"
# 组合过滤:字节跳动 + 中文 + 男声curl "https://stardust.ticos.cn/tts?provider=bytedance&language=chinese&gender=male"