- 账户权益管理API
- 短视频离线合成API
- 调用须知
- 常见问题
- 流式TTS-音色需报备
- 短视频作品合成、编辑和查询
- 音频作品合成、编辑和查询
- 数字人和音色模型
- 素材准备和编辑
- 直播OpenApi
- 数字人互动
创建视频合成任务-音频文件
POST
/openApiDigitalPerson/customer/composeWithAudio
支持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 {2}]
场景列表
trackPO
object
必需
orderBy
integer
排序
name
string
xxx作品
isPreview
string
可选
align
enum<string>
VERTICAL
枚举值:
HORIZONTALVERTICAL
resolution
string
1080P
示例
{
"name": "测试OpenApi的作品0712-1",
"resolution": "1080P",
"align": "VERTICAL",
"sceneVOList": [
{
"orderBy": 1,
"trackPO": {
"audioTrack": [
{
"duration": 10.893063,
"digitalPersonWorksUploadAudioId": 994,
"durationBySpeed": 10.893063,
"mediaURL": "https://digital-person-daily.oss-cn-hangzhou.aliyuncs.com/virtual_human/81/Audio/Record/1689063568381/口播老师1.MP3"
}
],
"backGroundImageTrack": {
"backgroundId": 324,
"mediaURL": "https://digital-person-daily.oss-cn-hangzhou.aliyuncs.com/FileUpload/1/UID_1/Image/Background/766217fa27993ecdc73d8abf326cbec8_1678409491325.jpg"
},
"digitalPersonTrack": [
{
"z": 3,
"digitalPersonAssetsId": 135,
"name": "白白",
"scale": 1,
"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
}
],
"imageTrack": [
{
"z": 2,
"speed": 1,
"type": "Image",
"name": "加入我粉丝团.png",
"timelineIn": 0,
"timelineOut": 10.893063,
"y": 493.843,
"x": 0,
"mediaURL": "https://digital-person.oss-cn-hangzhou.aliyuncs.com/FileUpload/UID_196/File/2023-12-08/1701999438939加入我粉丝团.png",
"height": 932.314,
"width": 1082.0493
},
{
"z": 1,
"speed": 1,
"type": "Image",
"name": "加入我粉丝团.png",
"timelineIn": 0,
"timelineOut": 10.893063,
"y": -8.9274235,
"x": -51.00569,
"mediaURL": "https://digital-person.oss-cn-hangzhou.aliyuncs.com/FileUpload/UID_196/File/2023-12-08/1701999438939加入我粉丝团.png",
"height": 932.314,
"width": 1082.0493
}
],
"subtitleTrack": [
{
"timelineIn": 2,
"timelineOut": 5,
"type": "Text",
"x": 0.1,
"y": 0.1,
"content": "系统花字",
"fontSize": 150,
"effectColorStyle": "CS0001-000004"
},
{
"type": "Text",
"content": "你好呀",
"timelineIn": 0,
"timelineOut": 5.813,
"z": 100,
"backColour": "#00000000",
"font": "SiYuan Heiti",
"fontSize": 58.29222011385199,
"fontColor": "#ffffff",
"outlineColour": "#000000",
"fontFace": {
"bold": false,
"underline": false,
"italic": false
},
"x": 541.0246679316888,
"y": 1400,
"outlinef": 6,
"textWidth": 174.87666034155598,
"textHeight": 58.29222011385199,
"textRows": [
"你好呀"
],
"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 '/openApiDigitalPerson/customer/composeWithAudio' \
--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": "测试OpenApi的作品0712-1",
"resolution": "1080P",
"align": "VERTICAL",
"sceneVOList": [
{
"orderBy": 1,
"trackPO": {
"audioTrack": [
{
"duration": 10.893063,
"digitalPersonWorksUploadAudioId": 994,
"durationBySpeed": 10.893063,
"mediaURL": "https://digital-person-daily.oss-cn-hangzhou.aliyuncs.com/virtual_human/81/Audio/Record/1689063568381/口播老师1.MP3"
}
],
"backGroundImageTrack": {
"backgroundId": 324,
"mediaURL": "https://digital-person-daily.oss-cn-hangzhou.aliyuncs.com/FileUpload/1/UID_1/Image/Background/766217fa27993ecdc73d8abf326cbec8_1678409491325.jpg"
},
"digitalPersonTrack": [
{
"z": 3,
"digitalPersonAssetsId": 135,
"name": "白白",
"scale": 1,
"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
}
],
"imageTrack": [
{
"z": 2,
"speed": 1,
"type": "Image",
"name": "加入我粉丝团.png",
"timelineIn": 0,
"timelineOut": 10.893063,
"y": 493.843,
"x": 0,
"mediaURL": "https://digital-person.oss-cn-hangzhou.aliyuncs.com/FileUpload/UID_196/File/2023-12-08/1701999438939加入我粉丝团.png",
"height": 932.314,
"width": 1082.0493
},
{
"z": 1,
"speed": 1,
"type": "Image",
"name": "加入我粉丝团.png",
"timelineIn": 0,
"timelineOut": 10.893063,
"y": -8.9274235,
"x": -51.00569,
"mediaURL": "https://digital-person.oss-cn-hangzhou.aliyuncs.com/FileUpload/UID_196/File/2023-12-08/1701999438939加入我粉丝团.png",
"height": 932.314,
"width": 1082.0493
}
],
"subtitleTrack": [
{
"timelineIn": 2,
"timelineOut": 5,
"type": "Text",
"x": 0.1,
"y": 0.1,
"content": "系统花字",
"fontSize": 150,
"effectColorStyle": "CS0001-000004"
},
{
"type": "Text",
"content": "你好呀",
"timelineIn": 0,
"timelineOut": 5.813,
"z": 100,
"backColour": "#00000000",
"font": "SiYuan Heiti",
"fontSize": 58.29222011385199,
"fontColor": "#ffffff",
"outlineColour": "#000000",
"fontFace": {
"bold": false,
"underline": false,
"italic": false
},
"x": 541.0246679316888,
"y": 1400,
"outlinef": 6,
"textWidth": 174.87666034155598,
"textHeight": 58.29222011385199,
"textRows": [
"你好呀"
],
"speed": 1
}
]
}
}
]
}'
返回响应
🟢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": 2454,
"requestId": "qvshUtaa",
"resultMsg": "执行成功",
"host": "develop-007",
"errorStackTrace": null
}
修改于 2024-12-13 01:49:52