- 账户权益管理API
- 短视频离线合成API
- 调用须知
- 常见问题
- 流式TTS-音色需报备
- 短视频作品合成、编辑和查询
- 音频作品合成、编辑和查询
- 数字人和音色模型
- 素材准备和编辑
- 直播OpenApi
- 数字人互动
创建视频合成任务-TTS合成
POST
/openApiDigitalPerson/customer/composeWithTTS
支持JPG/JPEG/PNG图片,最多可同时上传100张背景,图片限制30M。
仅支持mp3、wav、m4a、flac格式
JPG/JPEG/PNG/GIF格式图片,限制30M
mp4/webm/mov/flv格式,限制500M
请求参数
Header 参数
authorization
string
必需
示例值:
{{auth|md5}}
req_from
string
必需
示例值:
C
timestamp
integer
时间戳
示例值:
{{timestamp}}
app_id
string
必需
示例值:
{{appId}}
account
string
可选
示例值:
19999999999
Body 参数application/json
sceneVOList
array [object {10}]
场景列表
trackPO
object
可选
speechStr
string
播放速度
textList
array[string]
文案列表
digitalPersonWorksId
integer
数字人作品id
orderBy
integer
排序
voice
string
音色
sourceType
integer
音色类型
lang
string
语言
role
string
角色
style
string
状态
isPreview
boolean
可选
name
string
xxx作品
align
enum<string>
VERTICAL
枚举值:
HORIZONTALVERTICAL
resolution
string
1080P
示例
{
"name": "测试TTS作品",
"align": "VERTICAL",
"resolution": "1080P",
"sceneVOList": [
{
"orderBy": 1,
"voice": "ailun",
"speechStr": "1",
"textList": [
"1111111",
"222222",
"333333",
"4444444"
],
"trackPO": {
"backGroundImageTrack": {
"backgroundId": 324,
"mediaURL": "https://digital-person-daily.oss-cn-hangzhou.aliyuncs.com/FileUpload/1/UID_1/Image/Background/766217fa27993ecdc73d8abf326cbec8_1678409491325.jpg"
},
"digitalPersonTrack": [
{
"z": 1,
"digitalPersonAssetsId": 135,
"previewUrl": "virtual_human/templates/白白_1682217983080_1682242874279632/sample.mp4",
"scale": null,
"height": 1920,
"type": "Video",
"x": 0,
"y": 0,
"mediaURL": "https://digital-person-daily.oss-cn-hangzhou.aliyuncs.com/virtual_human/templates/白白_1682217983080_1682242874279632/白白_1682217983080_1682242874279632.png",
"width": 1080
}
]
}
}
]
}
示例代码
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/composeWithTTS' \
--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 '{
"name": "测试TTS作品",
"align": "VERTICAL",
"resolution": "1080P",
"sceneVOList": [
{
"orderBy": 1,
"voice": "ailun",
"speechStr": "1",
"textList": [
"1111111",
"222222",
"333333",
"4444444"
],
"trackPO": {
"backGroundImageTrack": {
"backgroundId": 324,
"mediaURL": "https://digital-person-daily.oss-cn-hangzhou.aliyuncs.com/FileUpload/1/UID_1/Image/Background/766217fa27993ecdc73d8abf326cbec8_1678409491325.jpg"
},
"digitalPersonTrack": [
{
"z": 1,
"digitalPersonAssetsId": 135,
"previewUrl": "virtual_human/templates/白白_1682217983080_1682242874279632/sample.mp4",
"scale": null,
"height": 1920,
"type": "Video",
"x": 0,
"y": 0,
"mediaURL": "https://digital-person-daily.oss-cn-hangzhou.aliyuncs.com/virtual_human/templates/白白_1682217983080_1682242874279632/白白_1682217983080_1682242874279632.png",
"width": 1080
}
]
}
}
]
}'
返回响应
🟢200成功
application/json
Body
com.yiwise.base.model.bean.ResultModel<java.lang.Long>
code
integer
可选
默认值:
CommonErrorCode.SUCCESS.getCode()
data
integer
返回的数据
requestId
string
请求唯一标记
resultMsg
string
提示信息
默认值:
CommonErrorCode.SUCCESS.getDesc()
host
string
业务主机名
默认值:
getHostName()
errorStackTrace
string
异常堆栈
示例
{
"code": 200,
"data": 2455,
"requestId": "cNHs1ZpE",
"resultMsg": "执行成功",
"host": "develop-007",
"errorStackTrace": null
}
修改于 2024-12-13 01:50:04