Edge TTS Studio

Microsoft Edge TTS

0 / 5000
正常
正常

API 接口文档

获取语音列表

GET /api/voices
curl -X GET /api/voices

返回所有可用语音列表,按语言分组。

文本转语音

POST /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
参数类型说明
textstring要转换的文本(必填)
voicestring语音ID,如 zh-CN-XiaoxiaoNeural
ratestring语速,范围 -100% ~ +100%
volumestring音量,范围 -100% ~ +100%
pitchstring音调,范围 -50Hz ~ +50Hz
subtitlebool是否返回 SRT 字幕

带字幕的转换

POST /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。

语音预览

GET /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