> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hingnet.com.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 对口型

> 为视频添加音频或文字配音

## 概述

对口型（lip-sync）用于将已有视频与音频或文本结合，生成嘴型同步的视频。

> \[!NOTE]
>
> * **本平台接口**：`POST https://models.hingnet.com.cn/vidu/ent/v2/lip-sync`
> * **官方接口**：`POST https://api.vidu.cn/ent/v2/lip-sync`，详见 [官方 API 文档](https://platform.vidu.cn/docs/lip-sync)

## 请求参数

| 参数              | 类型     | 必填 | 说明                         |
| --------------- | ------ | -- | -------------------------- |
| `video_url`     | string | ✅  | 原视频 URL                    |
| `audio_url`     | string | ⚠️ | 音频文件 URL（与 `text` 二选一）     |
| `text`          | string | ⚠️ | 驱动口型的文本（与 `audio_url` 二选一） |
| `speed`         | float  | ❌  | 语速 0.5–2，默认 1.0（仅文字驱动）     |
| `voice_id`      | string | ❌  | 音色 ID（仅文字驱动）               |
| `ref_photo_url` | string | ❌  | 人脸参考图 URL（多人脸时指定目标）        |
| `volume`        | int    | ❌  | 音量 0–10，默认 0               |
| `callback_url`  | string | ❌  | 回调地址                       |
| `payload`       | string | ❌  | 透传字段                       |

> \[!IMPORTANT]
> `audio_url` 和 `text` 至少需要提供其中之一。

## 音频驱动

```bash theme={null}
curl -X POST "https://models.hingnet.com.cn/vidu/ent/v2/lip-sync" \
  -H "Authorization: Bearer <HingNet AI Token>" \
  -H "Content-Type: application/json" \
  -d '{
    "video_url": "https://your.cdn.com/source.mp4",
    "audio_url": "https://your.cdn.com/audio.wav",
    "callback_url": "https://your.service.com/callback"
  }'
```

**支持的音频格式：** wav / mp3 / wma / m4a / aac / ogg

## 文本驱动

```bash theme={null}
curl -X POST "https://models.hingnet.com.cn/vidu/ent/v2/lip-sync" \
  -H "Authorization: Bearer <HingNet AI Token>" \
  -H "Content-Type: application/json" \
  -d '{
    "video_url": "https://your.cdn.com/source.mp4",
    "text": "你好<#2#>我是 Vidu<#1.5#>很高兴见到你",
    "speed": 1.0,
    "voice_id": "your_voice_id"
  }'
```

**文本语法：** 使用 `<#x#>` 插入 x 秒停顿

## 返回示例

```json theme={null}
{
  "task_id": "your_task_id_here",
  "state": "created",
  "payload": "user_123_order_456",
  "created_at": "2025-01-01T15:41:31.968Z"
}
```

## 计费说明

| 能力  | 计费规则              |
| --- | ----------------- |
| 对口型 | 每生成 5 秒视频，扣 20 积分 |

## 视频要求

* 编码：H.264
* 时长：1–600 秒
* 大小：≤ 5GB

## 查询结果

任务创建成功后，通过 [任务查询](/vidu/video-query) 接口获取最终结果。
