0 / 5000
Microsoft Edge TTS
/api/voices
curl -X GET /api/voices
返回所有可用语音列表,按语言分组。
/api/synthesize
curl -X POST /api/synthesize \
-H "Content-Type: application/json" \
-d '{
"text": "你好,这是一段测试文本",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "+0%",
"volume": "+0%",
"pitch": "+0Hz"
}' \
--output output.mp3
| 参数 | 类型 | 说明 |
|---|---|---|
| text | string | 要转换的文本(必填) |
| voice | string | 语音ID,如 zh-CN-XiaoxiaoNeural |
| rate | string | 语速,范围 -100% ~ +100% |
| volume | string | 音量,范围 -100% ~ +100% |
| pitch | string | 音调,范围 -50Hz ~ +50Hz |
| subtitle | bool | 是否返回 SRT 字幕 |
/api/synthesize
curl -X POST /api/synthesize \
-H "Content-Type: application/json" \
-d '{
"text": "你好,这是一段测试文本",
"voice": "zh-CN-YunxiNeural",
"rate": "+20%",
"subtitle": true
}' \
--output output.zip
当 subtitle=true 时,返回 ZIP 文件,包含 audio.mp3 和 subtitle.srt。
/api/voices/{voiceId}/sample
curl -X GET /api/voices/zh-CN-XiaoxiaoNeural/sample \ --output sample.mp3
获取指定语音的示例音频。
# 英语语音
curl -X POST /api/synthesize \
-H "Content-Type: application/json" \
-d '{"text": "Hello World", "voice": "en-US-AriaNeural"}' \
--output hello.mp3
# 日语语音,加快语速
curl -X POST /api/synthesize \
-H "Content-Type: application/json" \
-d '{"text": "こんにちは", "voice": "ja-JP-NanamiNeural", "rate": "+30%"}' \
--output japanese.mp3
# 粤语语音
curl -X POST /api/synthesize \
-H "Content-Type: application/json" \
-d '{"text": "你好", "voice": "zh-HK-HiuGaaiNeural"}' \
--output cantonese.mp3