声音克隆 Voice Clone
只需 10 秒音频样本即可创建高保真声音克隆体,保留原始音色、语调和情感特征。克隆完成后可在 TTS 接口中使用自定义音色进行语音合成,广泛应用于品牌定制、有声书播讲、虚拟人、客服语音等场景。 Create high-fidelity voice clones from just 10 seconds of audio, preserving the original timbre, intonation, and emotion. Use cloned voices in the TTS API for custom speech synthesis across branding, audiobooks, virtual humans, and customer service scenarios.
快速概览 Quick Overview
属性 Attribute 说明 Description
克隆端点 Clone Endpoint POST /v1/voice/clone
列表端点 List Endpoint GET /v1/voice/clone
删除端点 Delete Endpoint DELETE /v1/voice/clone/{voice_id}
认证 Authentication Bearer Token(Authorization 请求头) Bearer Token in Authorization header
请求体 Request Body multipart/form-data(文件上传)multipart/form-data (file upload)
样本时长 Sample Duration 10 ~ 60 秒,推荐 30 秒以上 10 ~ 60 seconds, 30+ recommended
支持格式 Supported Formats WAV / MP3 / FLAC / M4A / OGG WAV / MP3 / FLAC / M4A / OGG
文件上限 Max File Size 50 MB
音色配额 Voice Quota 每账号最多 10 个自定义音色 Up to 10 custom voices per account
处理方式 Processing Mode 同步返回 / 异步回调(长样本推荐) Sync response / async callback (recommended for long samples)
创建克隆 Create Clone
POST /v1/voice/clone
认证 Authentication
所有 API 请求需在 HTTP Header 中携带 Access Token。
All API requests must include an Access Token in the HTTP Header.
Authorization: Bearer {access_token}
请求头 Request Headers
请求头 Header 必填 Required 说明 Description
Authorizationrequired 格式 Bearer {access_token},用于身份认证 Format: Bearer {access_token}, used for authentication
Content-Typerequired 固定为 multipart/form-data,请勿手动设置,让 HTTP 客户端自动生成 Must be multipart/form-data; do not set manually, let the HTTP client generate it
请求参数 Request Parameters
参数 Parameter 类型 Type 必填 Required 说明 Description
sample file / string required 参考音频文件(multipart 上传)或音频 URL。10~60 秒,WAV/MP3/FLAC/M4A/OGG,≤50MB Reference audio file (multipart) or audio URL. 10~60 seconds, WAV/MP3/FLAC/M4A/OGG, ≤50MB
voice_name string required 克隆音色名称,1~64 字符,同账号下需唯一 Custom voice name, 1~64 chars, unique per account
lang string required 样本语言代码,影响合成发音准确性。如 zh、en、ja。详见语种列表 Sample language code for synthesis accuracy, e.g. zh, en, ja. See Language List
description string optional 音色描述/备注,便于管理,最长 200 字符 Voice description / notes, max 200 chars
enhance_quality boolean optional 是否启用增强质量模式(更深度训练,耗时更长但音色还原度更高),默认 false Enable enhanced quality mode (deeper training, longer processing but higher fidelity), default false
noise_reduction boolean optional 是否自动降噪处理参考音频,默认 true。样本本身已降噪时可关闭 Auto noise reduction for reference audio, default true. Disable if sample is already clean
gender string optional 指定性别辅助建模:male / female / unknown,默认 unknown 自动检测 Specify gender to assist modeling: male / female / unknown, default unknown (auto-detect)
callback_url string optional 异步回调地址。启用 enhance_quality 时建议使用此模式,训练完成后通过 HTTP POST 推送结果 Async callback URL. Recommended with enhance_quality; results pushed via HTTP POST on completion
音频样本要求 Audio Sample Requirements
要求项 Requirement 推荐值 Recommended 说明 Notes
时长 Duration 30 ~ 60 秒 30 ~ 60 seconds
最短 10 秒,推荐 30 秒以上以获得更稳定克隆效果
Minimum 10 seconds; 30+ recommended for stable cloning
采样率 Sample Rate 16 kHz / 44.1 kHz / 48 kHz
16kHz 为最低要求,48kHz 高保真
16kHz minimum, 48kHz for high fidelity
声道 Channels 单声道(推荐) Mono (recommended)
多声道将自动混缩为单声道处理
Multi-channel will be auto-downmixed to mono
格式 Format WAV(推荐)/ MP3 / FLAC
WAV 无损格式效果最佳,MP3 建议 ≥128kbps
WAV lossless gives best results; MP3 ≥128kbps
信噪比 SNR ≥ 20 dB
≥ 20 dB
背景噪音过大会降低克隆质量,建议在安静环境录制
Excessive background noise reduces quality; record in a quiet environment
文件大小 File Size ≤ 50 MB
≤ 50 MB
超过限制请先裁剪或压缩
Trim or compress if exceeding the limit
💡 录制高质量样本的建议
💡 Tips for Recording Quality Samples
使用电容麦克风或手机原声录制,避免使用蓝牙耳机(易丢帧)
Use a condenser mic or native phone recorder; avoid Bluetooth headsets (frame drops)
录制自然口语化内容,包含长句和短句,覆盖不同语调变化
Record natural conversational content with a mix of long and short sentences
保持正常语速,避免过快或过慢,停顿自然
Maintain normal pace; avoid too fast or too slow, with natural pauses
选择情绪中立的内容,避免极端情绪影响通用性
Choose emotionally neutral content; extreme emotions affect versatility
请求示例 Request Examples
cURL
Python
JavaScript
Java
Go
# 基础克隆
curl -X POST https://api.itranslator.cc/v1/voice/clone \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-F "sample=@my_voice.wav" \
-F "voice_name=My Brand Voice" \
-F "lang=zh"
# 增强质量 + 自动降噪关闭 + 异步回调
curl -X POST https://api.itranslator.cc/v1/voice/clone \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-F "sample=@voice_sample.wav" \
-F "voice_name=Professional Narrator" \
-F "lang=en" \
-F "enhance_quality=true" \
-F "noise_reduction=true" \
-F "gender=female" \
-F "description=用于有声书播讲的专业女声" \
-F "callback_url=https://myapp.com/webhook/voice-clone"
# 通过音频 URL 克隆(无需本地文件)
curl -X POST https://api.itranslator.cc/v1/voice/clone \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sample": "https://cdn.example.com/voice_sample.wav",
"voice_name": "Host Voice",
"lang": "ja"
}'
import requests
token = "YOUR_ACCESS_TOKEN"
url = "https://api.itranslator.cc/v1/voice/clone"
# 基础克隆
resp = requests.post(
url,
headers={"Authorization": f"Bearer {token}"},
files={"sample": open("my_voice.wav", "rb")},
data={"voice_name": "My Brand Voice", "lang": "zh"}
)
print(resp.json())
# 增强质量 + 异步回调
resp = requests.post(
url,
headers={"Authorization": f"Bearer {token}"},
files={"sample": open("voice_sample.wav", "rb")},
data={
"voice_name": "Professional Narrator",
"lang": "en",
"enhance_quality": "true",
"noise_reduction": "true",
"gender": "female",
"description": "用于有声书播讲的专业女声",
"callback_url": "https://myapp.com/webhook/voice-clone"
}
)
result = resp.json()
print(f"voice_id: {result['voice_id']}, status: {result['status']}")
const fs = require("fs");
const FormData = require("form-data");
const axios = require("axios");
const form = new FormData();
form.append("sample", fs.createReadStream("my_voice.wav"));
form.append("voice_name", "My Brand Voice");
form.append("lang", "zh");
form.append("enhance_quality", "true");
form.append("description", "品牌定制音色");
const resp = await axios.post(
"https://api.itranslator.cc/v1/voice/clone",
form,
{
headers: {
...form.getHeaders(),
Authorization: `Bearer ${process.env.API_TOKEN}`
}
}
);
console.log(resp.data);
// { voice_id: "custom-zh-abc123", status: "ready", quality_score: 0.92, ... }
import okhttp3.*;
import java.io.File;
import java.io.IOException;
OkHttpClient client = new OkHttpClient();
RequestBody body = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("sample", "my_voice.wav",
RequestBody.create(new File("my_voice.wav"), MediaType.parse("audio/wav")))
.addFormDataPart("voice_name", "My Brand Voice")
.addFormDataPart("lang", "zh")
.addFormDataPart("enhance_quality", "true")
.addFormDataPart("description", "品牌定制音色")
.build();
Request request = new Request.Builder()
.url("https://api.itranslator.cc/v1/voice/clone")
.header("Authorization", "Bearer " + token)
.post(body)
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println(response.body().string());
}
package main
import (
"bytes"
"fmt"
"io"
"mime/multipart"
"net/http"
"os"
)
func main() {
file, _ := os.Open("my_voice.wav")
defer file.Close()
var buf bytes.Buffer
writer := multipart.NewWriter(&buf)
fw, _ := writer.CreateFormFile("sample", "my_voice.wav")
io.Copy(fw, file)
writer.WriteField("voice_name", "My Brand Voice")
writer.WriteField("lang", "zh")
writer.WriteField("enhance_quality", "true")
writer.Close()
req, _ := http.NewRequest("POST",
"https://api.itranslator.cc/v1/voice/clone", &buf)
req.Header.Set("Authorization", "Bearer "+os.Getenv("API_TOKEN"))
req.Header.Set("Content-Type", writer.FormDataContentType())
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
响应字段说明 Response Fields
字段 Field 类型 Type 说明 Description
voice_id string 克隆音色唯一 ID,在 TTS 接口中作为 voice 参数使用 Unique clone voice ID; use as voice in TTS API
voice_name string 克隆音色名称 Custom voice name
lang string 样本语言代码 Sample language code
quality_score float 克隆质量评分(0~1),衡量克隆音色与样本的相似度,≥0.85 为优秀 Clone quality score (0~1); measures similarity to sample; ≥0.85 is excellent
status string 克隆状态:processing(训练中)/ ready(就绪可用)/ failed(失败) Status: processing / ready / failed
description string 音色描述(如传入则返回) Voice description (returned if provided)
sample_duration float 参考音频时长(秒) Reference audio duration in seconds
created_at string 创建时间(ISO 8601 UTC) Creation time (ISO 8601 UTC)
响应示例 Response Example
同步模式(基础克隆) Sync Mode (Basic Clone)
{
"voice_id": "custom-zh-abc123",
"voice_name": "My Brand Voice",
"lang": "zh",
"quality_score": 0.92,
"status": "ready",
"sample_duration": 35.2,
"created_at": "2026-07-20T10:00:00Z"
}
异步模式(增强质量克隆) Async Mode (Enhanced Clone)
启用 enhance_quality=true 或使用 callback_url 时,接口立即返回 processing 状态,训练完成后通过回调推送最终结果:
When enhance_quality=true or callback_url is used, the API returns processing immediately; the final result is pushed via callback upon completion:
// 同步响应
{
"voice_id": "custom-en-def456",
"voice_name": "Professional Narrator",
"lang": "en",
"status": "processing",
"created_at": "2026-07-20T10:05:00Z"
}
// 回调推送(POST 到 callback_url)
{
"voice_id": "custom-en-def456",
"voice_name": "Professional Narrator",
"lang": "en",
"quality_score": 0.96,
"status": "ready",
"sample_duration": 52.8,
"created_at": "2026-07-20T10:05:00Z",
"completed_at": "2026-07-20T10:08:30Z"
}
质量评分说明 Quality Score Reference
评分区间 Score Range 等级 Grade 说明 Description
0.90 ~ 1.0 优秀 Excellent 高度还原原始音色,适合专业级应用 Highly faithful to original; suitable for professional use
0.80 ~ 0.89 良好 Good 还原度较好,适合大多数常规场景 Good fidelity; suitable for most common scenarios
0.70 ~ 0.79 一般 Fair 可辨识但存在偏差,建议优化样本后重新克隆 Recognizable but with deviations; optimize sample and re-clone
< 0.70 较差 Poor 还原度低,通常因样本质量差或时长不足,建议更换样本 Low fidelity, usually due to poor sample quality or short duration; replace sample
使用克隆音色 Using Cloned Voice
创建克隆后,在 TTS 接口的 voice 参数中传入 voice_id 即可使用。克隆音色支持 TTS 的所有高级特性,包括语速、音调、音量、情绪等参数控制。 After cloning, pass the voice_id to the TTS API's voice parameter. Cloned voices support all TTS advanced features including speed, pitch, volume, and emotion control.
# 基础使用
curl -X POST https://api.itranslator.cc/v1/tts \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"text": "你好,这是克隆后的声音。", "voice": "custom-zh-abc123"}' \
-o output.mp3
# 带语速和情绪的高级使用
curl -X POST https://api.itranslator.cc/v1/tts \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"text": "新品上市啦,限时八折优惠!",
"voice": "custom-zh-abc123",
"emotion": "happy",
"emotion_intensity": "strong",
"speed": 1.1,
"output_format": "mp3"
}' \
-o promo.mp3
Copy
💡 克隆音色与原生音色对比
💡 Cloned vs. Native Voices
克隆音色与原生音色在 TTS 接口中使用方式完全一致,无需额外参数
Cloned voices work identically to native voices in the TTS API; no extra params needed
情绪风格支持取决于样本特征,建议使用中性样本以保证情绪控制的灵活性
Emotion support depends on sample characteristics; neutral samples offer better emotion flexibility
克隆音色的合成延迟与原生音色基本一致,无明显性能损耗
Cloned voice synthesis latency matches native voices with no significant overhead
查询克隆列表 List Cloned Voices
GET /v1/voice/clone
查询当前账号下所有克隆音色,支持按状态筛选。
List all cloned voices under the current account, filterable by status.
查询参数 Query Parameters
参数 Parameter 类型 Type 说明 Description
status string optional 按状态筛选:processing / ready / failed Filter by status: processing / ready / failed
lang string optional 按语言代码筛选 Filter by language code
列表响应示例 List Response Example
{
"voices": [
{
"voice_id": "custom-zh-abc123",
"voice_name": "My Brand Voice",
"lang": "zh",
"quality_score": 0.92,
"status": "ready",
"sample_duration": 35.2,
"created_at": "2026-07-20T10:00:00Z"
},
{
"voice_id": "custom-en-def456",
"voice_name": "Professional Narrator",
"lang": "en",
"quality_score": 0.96,
"status": "ready",
"description": "用于有声书播讲的专业女声",
"sample_duration": 52.8,
"created_at": "2026-07-20T10:05:00Z"
}
],
"total": 2,
"quota": 10
}
删除克隆音色 Delete Cloned Voice
DELETE /v1/voice/clone/{voice_id}
删除指定的克隆音色。删除后该 voice_id 将无法再用于 TTS 合成,且释放配额。此操作不可撤销。
Delete a cloned voice. After deletion, the voice_id can no longer be used for TTS, and the quota is released. This action is irreversible.
curl -X DELETE https://api.itranslator.cc/v1/voice/clone/custom-zh-abc123 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Copy
{
"voice_id": "custom-zh-abc123",
"deleted": true
}
更新克隆信息 Update Cloned Voice
PUT /v1/voice/clone/{voice_id}
更新克隆音色的名称和描述。注意:无法更新参考音频和语言代码,如需更换样本请新建克隆。
Update the name and description of a cloned voice. Note: the reference audio and language cannot be updated; create a new clone to change the sample.
参数 Parameter 类型 Type 必填 Required 说明 Description
voice_name string optional 新的音色名称 New voice name
description string optional 新的音色描述 New voice description
curl -X PUT https://api.itranslator.cc/v1/voice/clone/custom-zh-abc123 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"voice_name": "Brand Voice v2", "description": "更新后的品牌音色"}'
Copy
注意事项
Notes
建议使用干净无背景噪音的音频样本,以获得最佳克隆效果
Use clean audio samples without background noise for optimal cloning quality.
每个账号最多创建 10 个自定义音色,删除后可释放配额
Maximum 10 custom voices per account; deletion releases quota.
克隆音色需等待 status 变为 ready 后才能用于 TTS 合成
Cloned voices can only be used for TTS after status becomes ready.
质量评分 < 0.70 时建议优化样本后重新克隆
If quality score < 0.70, optimize the sample and re-clone.
请确保拥有参考音频的合法使用权,遵守相关法律法规
Ensure you have legal rights to use the reference audio and comply with applicable laws.
错误码 Error Codes
HTTP Code 错误码 Error Code 说明 Description
200 0成功 Success
400 1001参数错误,请检查必填参数和参数格式 Invalid parameter; check required fields and format
400 1006音色名称已存在,同账号下需唯一 Voice name already exists; must be unique per account
400 1007音频时长不足 10 秒或超过 60 秒 Audio duration below 10 seconds or exceeds 60 seconds
400 1008音频信噪比过低,建议在安静环境重新录制 Audio SNR too low; re-record in a quiet environment
400 1009未检测到有效语音,可能为静音或纯噪音 No valid speech detected; may be silence or pure noise
401 2001认证失败,Token 无效或已过期 Authentication failed; invalid or expired token
403 2003无权限访问该资源 Access denied; insufficient permissions
403 2004自定义音色配额已满(最多 10 个),请先删除不需要的音色 Voice quota full (max 10); delete unused voices first
404 2005指定的 voice_id 不存在或已删除 Specified voice_id does not exist or has been deleted
413 3001文件大小超出限制(最大 50 MB) File size exceeds limit (max 50 MB)
415 3002不支持的文件格式 Unsupported file format
422 3003克隆训练失败,建议优化样本质量后重试 Clone training failed; optimize sample quality and retry
429 4001请求频率超限,请稍后重试 Rate limit exceeded; please retry later
456 4002套餐配额已用尽,请升级或等待重置 Plan quota exhausted; upgrade or wait for reset
500 5001服务器处理失败,请重试或联系技术支持 Server processing failed; retry or contact support
503 5002服务暂时不可用,建议稍后重试 Service temporarily unavailable; retry later
最佳实践 Best Practices
样本质量优先 :清晰、无噪音的音频是高质量克隆的基础。建议在安静室内使用外置麦克风录制,避免回声和环境干扰。
Sample Quality First : Clear, noise-free audio is the foundation of high-quality cloning. Record in a quiet room with an external microphone, avoiding echoes and interference.
合理选择时长 :10 秒为最低要求,30 秒以上可获得更稳定的效果。并非越长越好,60 秒以上无明显收益。
Choose Duration Wisely : 10 seconds is the minimum; 30+ seconds yields more stable results. Longer isn't always better; 60+ seconds offers no significant gain.
增强质量模式 :专业场景(有声书、品牌语音)建议启用 enhance_quality=true,并配合异步回调避免超时。
Enhanced Quality : For professional use (audiobooks, brand voice), enable enhance_quality=true with async callback to avoid timeouts.
配额管理 :每账号限 10 个音色,定期通过列表接口清理不再使用的克隆,及时删除释放配额。
Quota Management : Limited to 10 voices per account; regularly clean up unused clones via the list API to free up quota.
状态轮询 :异步模式下建议轮询列表接口或等待回调,确认 status=ready 后再用于 TTS 合成。
Status Polling : In async mode, poll the list API or wait for callback; confirm status=ready before using in TTS.
合规使用 :仅克隆拥有合法使用权的音频,严禁克隆他人声音用于欺骗或冒充。
Compliance : Only clone audio you have legal rights to; never clone others' voices for deception or impersonation.
应用场景 Use Cases
场景 Scenario 推荐配置 Recommended Config 说明 Notes
🏢 品牌定制语音
🏢 Brand Voice
增强质量 + 30s 样本
Enhanced + 30s sample
统一品牌对外语音形象,用于广告、宣传视频、IVR 语音导航
Consistent brand voice for ads, promos, and IVR systems
📖 有声书播讲
📖 Audiobook Narration
增强质量 + 60s 样本 + 情绪
Enhanced + 60s sample + emotion
克隆播音员声音,长文本批量合成,多角色多音色切换
Clone narrator voice for batch long-text synthesis with multi-role switching
🤖 虚拟人/数字人
🤖 Virtual Human
增强质量 + 48kHz 样本
Enhanced + 48kHz sample
为虚拟主播、数字员工定制专属声音,配合唇形同步
Custom voices for virtual anchors and digital employees with lip-sync
🎧 客服语音
🎧 Customer Service
基础模式 + 30s 样本
Basic + 30s sample
克隆客服人员声音,用于自动应答和语音通知,保持亲切感
Clone agent voice for auto-response and notifications with familiarity
🎮 游戏角色配音
🎮 Game Voice-Over
增强质量 + 多情绪
Enhanced + multi-emotion
克隆声优声音,快速生成不同情绪的角色台词
Clone voice actor for rapid generation of character lines with varied emotions
🌐 多语言本地化
🌐 Multi-language L10n
每语言一个克隆
One clone per language
同一说话人不同语言版本,保持音色一致性跨语言
Same speaker across languages with consistent timbre
使用说明
Notes
文件上传使用 multipart/form-data 编码,Content-Type 请勿手动设置,让 HTTP 客户端自动生成。
Use multipart/form-data encoding; let the HTTP client auto-generate Content-Type.
大文件建议分片上传或使用异步任务模式,避免请求超时。
For large files, use chunked upload or async task mode to avoid timeouts.
请勿在客户端代码中暴露 Access Token,建议通过后端代理调用。
Do not expose your Access Token in client-side code; use a backend proxy.