AI 音频
变声 / 音色转换
把一段语音的"说话内容"用另一段参考音色重新生成
变声(音色转换)= 给一段原始音频(要保留的说话内容)+ 一段参考音频(目标音色), 生成「用目标音色说出原内容」的语音。异步任务,提交后轮询查状态。
POST /api/v2/voice/convert
鉴权:Authorization: Bearer sk_...
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
source_audio_url | string | ✅ | 原始说话音频 URL |
reference_audio_url | string | ✅ | 目标音色参考 URL |
diffusion_steps | int | ⬜ | 推理步数,越大质量越好越慢 |
length_adjust | number | ⬜ | 时长缩放 |
inference_cfg_rate | number | ⬜ | CFG 强度 |
auto_f0_adjust | bool | ⬜ | 自动调音高 |
pitch_shift | int | ⬜ | 半音偏移 |
return_format | string | ⬜ | wav / mp3 |
enable_separation | bool | ⬜ | 是否先做人声分离 |
vocals_gain | number | ⬜ | 人声增益 |
accompaniment_gain | number | ⬜ | 伴奏增益 |
metadata | object | ⬜ | 透传业务字段 |
curl -X POST https://api.aiclonevoicefree.com/api/v2/voice/convert \
-H "Authorization: Bearer sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"source_audio_url": "https://oss.aiclonevoicefree.com/noise_removal/1751766508261_mandarin_speech_16kHz.wav",
"reference_audio_url": "https://oss.aiclonevoicefree.com/trump.wav",
"return_format": "wav"
}'响应 202 Accepted
{
"task_id": "99ae1ea9-01e3-4b15-9f89-d35c280f44b1",
"status": "pending",
"capability": "voice",
"action": "vocal-conversion",
"model": "voice-convert",
"created_at": 1780704377
}取结果
这是异步任务:上面拿到 task_id 后,轮询 GET /api/v2/tasks/{task_id},
status 变 completed 时 result 含转换后的音频:
curl https://api.aiclonevoicefree.com/api/v2/tasks/99ae1ea9-01e3-4b15-9f89-d35c280f44b1 \
-H "Authorization: Bearer sk_your_api_key"{
"status": "completed",
"capability": "voice",
"action": "vocal-conversion",
"audioUrl": "https://oss.aiclonevoicefree.com/...converted.wav",
"format": "wav",
"degraded": false,
"providerUsed": "voice-convert-1",
"completed_at": 1780704999
}轮询节奏、状态枚举、统一响应格式详见任务查询。
计费
按输出音频时长计费:2 积分/秒(时长向上取整,最低 1 秒)。
算例:
- 输出约 30 秒 = 30 × 2 = 60 积分
- 输出约 12.4 秒 = 向上取整到 13 秒 = 13 × 2 = 26 积分
完成结算、失败不扣费(见通用约定)。用的是语音积分。