sound_effect_content 指定音效方向,注:不是直接返回独立音频,最终产物仍是带音效的视频。准备源视频 -> 发起音效生成任务 -> 查询任务状态 -> 获取带音效视频| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
source_video_id | integer | 条件必填 | PixVerse 生成的视频 ID;与 video_media_id 二选一 |
video_media_id | integer | 条件必填 | 上传视频获得的 media ID;与 source_video_id 二选一 |
original_sound_switch | boolean | 否 | 是否保留原声,默认值是 false,false 不保留原视频音轨,true 将原音与新生成音效共同保留 |
sound_effect_content | string | 否 | 音效描述;为空时可根据视频内容生成省略和传 " " 明确等价,建议使用省略或空字符串,最大 2048 个 Unicode 字符,开启音效但内容为空时,系统会自动生成音效;模板场景则优先使用模板音乐 |
{
"source_video_id": 123456,
"original_sound_switch": true,
"sound_effect_content": "soft cinematic ambient music"
}| 字段 | 类型 | 说明 |
|---|---|---|
ErrCode | integer | 错误码,0 表示成功 |
ErrMsg | string | 错误信息,成功时通常为 Success |
Resp.video_id | integer | 视频任务 ID,后续用于查询任务状态 |
Resp.credits | integer | 本次任务预估或实际消耗点数,具体以平台返回为准 |
{
"ErrCode": 0,
"ErrMsg": "Success",
"Resp": {
"video_id": 123456,
"credits": 60
}
}video_id 获取生成进度和最终视频 URL。sound_effect_content 可以传空字符串。original_sound_switch 控制是否保留。curl --location 'https://app-api.pixverseai.cn/openapi/v2/video/sound_effect/generate' \
--header 'API-KEY: your-api-key' \
--header 'Ai-trace-id: 550e8400-e29b-41d4-a716-446655440000' \
--header 'Content-Type: application/json' \
--data '{
"source_video_id": 123456789,
"video_media_id": 987654321,
"original_sound_switch": false,
"sound_effect_content": "Ocean waves and soft wind",
"webhook_id": "your-webhook-id"
}'{
"ErrCode": 0,
"ErrMsg": "Success",
"Resp": {
"video_id": 123456789
}
}