语音合成 - TTS
POST
https://mapi.yunmaovideo.com/api-v1/tts
请求参数
Header 参数
Authorization
string
必需
示例值:
******
Body 参数application/json
type
enum<string>
音色类型(原 mode 参数)
枚举值:
custombuiltIn
示例值:
custom 或 builtIn
voiceId
string
音色Id
text
string
需要合成的文本
notify
string
回调地址
model
enum<string>
定制音色的语音合成模型(仅限 type 为 custom 时)
枚举值:
marsvenus
默认值:
mars
lang
string
文本的语言
示例值:
zh-cn
volume
number
音频的音量
默认值:
1
speed
number
音频的语速
默认值:
1
示例
{
"type": "builtIn",
"voiceId": "xiaoling",
"text": "这是一个测试",
"model": "venus",
"lang": "zh-cn",
"notify": "https://test123.com/notify",
"volume": 1,
"speed": 1
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://mapi.yunmaovideo.com/api-v1/tts' \
--header 'Authorization: ******' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "builtIn",
"voiceId": "xiaoling",
"text": "这是一个测试",
"model": "venus",
"lang": "zh-cn",
"notify": "https://test123.com/notify",
"volume": 1,
"speed": 1
}'
返回响应
🟢200提交成功
application/json
Body
code
integer
状态码
data
object
返回数据
taskId
string
必需
msg
string
返回信息
示例
{
"code": 0,
"data": {
"taskId": "VjZYavdrXhGy"
},
"msg": ""
}
🟢200回调-合成成功
🟢200回调-合成失败