本文档由 云音工坊 自动生成,如有疑问,请联系客服微信:yuntts !
POST https://www.yuntts.com/api/v1/indextts2_cloningAuthorization: Bearer <api_key>| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
name | string | 是 | 音色名称 |
description | string | 否 | 音色描述 |
speaker_file | file | 三选一 | 说话人音频文件(mp3/wav,5-30秒,≥16kHz,≤20MB) |
speaker_file_base64 | string | 三选一 | 说话人音频Base64编码 |
speaker_url | string | 三选一 | 说话人音频URL |
emotion_file | file | 可选三选一 | 情感音频文件(同上) |
emotion_file_base64 | string | 可选三选一 | 情感音频Base64编码 |
emotion_url | string | 可选三选一 | 情感音频URL |
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
name | string | 是 | 音色名称 |
description | string | 否 | 音色描述 |
speaker_file_base64 | string | 三选一 | 说话人音频Base64编码 |
speaker_url | string | 三选一 | 说话人音频URL |
emotion_file_base64 | string | 可选三选一 | 情感音频Base64编码 |
emotion_url | string | 可选三选一 | 情感音频URL |
注意:JSON 方式不支持直接上传文件( speaker_file、emotion_file),只能使用 Base64 或 URL。
| 属性 | 要求 |
|---|---|
| 格式 | mp3、wav |
| 时长 | 5-30秒 |
| 采样率 | ≥16kHz |
| 大小 | ≤20MB |
{
"code": 200,
"message": "上传成功!",
"data": {
"id": "v_abc123",
"name": "我的音色",
"status": "DEPLOYING",
"created_at": "2024-01-01T00:00:00Z"
}
}{
"code": 400,
"error": "invalid_speaker_file",
"message": "音频时长不符合要求(5-30秒)"
}| HTTP 状态码 | 错误码 | 说明 |
|---|---|---|
| 400 | empty_name | 缺少音色名称 |
| 400 | missing_speaker_file | 缺少 speaker_file/speaker_file_base64/speaker_url |
| 400 | invalid_file_format | 音频文件格式不支持(需mp3/wav) |
| 400 | file_too_large | 文件大小超过20MB |
| 400 | invalid_speaker_file | 音频时长或采样率不符合要求 |
| 400 | invalid_speaker_url | speaker_url格式无效 |
| 400 | invalid_emotion_file_format | 情感音频格式不支持 |
| 400 | emotion_file_too_large | 情感音频超过20MB |
| 400 | invalid_emotion_file | 情感音频时长或采样率不符合要求 |
| 400 | invalid_emotion_url | emotion_url格式无效 |
| 401 | empty_key | 缺少Authorization头 |
| 401 | invalid_key | API密钥无效 |
| 405 | method_not_allowed | 非POST请求 |
| 500 | request_failed | 请求失败 |