- 账户权益管理API
- 短视频离线合成API
- 调用须知
- 常见问题
- 流式TTS-音色需报备
- 短视频作品合成、编辑和查询
- 音频作品合成、编辑和查询
- 数字人和音色模型
- 素材准备和编辑
- 直播OpenApi
- 数字人互动
TTS合成接口
POST
/openApiDigitalPerson/customer/compose
done
请求参数
Header 参数
authorization
string
必需
示例值:
{{auth|md5}}
req_from
string
必需
示例值:
C
timestamp
integer
时间戳
示例值:
{{timestamp}}
app_id
string
必需
示例值:
{{appId}}
account
string
可选
示例值:
19999999999
Body 参数application/json
voice
string
音色
sourceType
integer
声音类型
role
string
角色
lang
string
必需
style
string
风格
speechStr
number
必需
textList
array[string]
合成文字列表
oriText
array[string]
原始文本
volume
integer
必需
示例
{
"voice": "XiaoxiaoNeural",
"sourceType": 1,
"role": "Default",
"lang": "zh-CN",
"style": "default",
"speechStr": 1,
"textList": [
"<speak>详情1234请私信或评论区留言</speak>"
],
"oriText": [
"1111222新"
],
"volume": 30
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/openApiDigitalPerson/customer/compose' \
--header 'authorization: {{auth|md5}}' \
--header 'req_from: C' \
--header 'timestamp: {{timestamp}}' \
--header 'app_id: {{appId}}' \
--header 'account: 19999999999' \
--header 'Content-Type: application/json' \
--data-raw '{
"voice": "XiaoxiaoNeural",
"sourceType": 1,
"role": "Default",
"lang": "zh-CN",
"style": "default",
"speechStr": 1,
"textList": [
"<speak>详情1234请私信或评论区留言</speak>"
],
"oriText": [
"1111222新"
],
"volume": 30
}'
返回响应
🟢200成功
application/json
Body
code
integer
必需
data
object
必需
duration
string
必需
durationList
array[number]
必需
url
string
必需
requestId
string
必需
resultMsg
string
必需
host
string
必需
errorStackTrace
string
必需
示例
{
"code": 500,
"data": {
"duration": "8.57475",
"durationList": [
8.57475
],
"url": "https://digital-person-daily.oss-cn-hangzhou.aliyuncs.com/virtual_human/audio/zhimi_emo_ZE5dPAlf_e495af3c3be611ee9a0a0242ac110009.wav"
},
"requestId": "ngVQ5vUH",
"resultMsg": "成功",
"host": "DESKTOP-I3F4OHS",
"errorStackTrace": "成功"
}
修改于 2024-09-19 11:23:07