음성 복제 (Voice Clone)

음성 복제 인터페이스 - 오디오 샘플을 업로드하여 특정 음성을 복제합니다. 복제된 음성은 음성 합성에 사용하여 개인 맞춤형 TTS를 구현할 수 있습니다.

API 엔드포인트

POST/voice_clone

음성 복제 작업 생성

GET/voice_clone/list

복제된 음성 목록 조회

요청 파라미터

파라미터타입필수설명
file_idstring필수업로드된 오디오 파일 ID
voice_namestring필수음성 이름
descriptionstring선택음성 설명

요청 예시

요청 예시
{
  "file_id": "file_xxxxx",
  "voice_name": "我的音色",
  "description": "基于示例音频克隆的音色"
}

응답 예시

응답 예시
{
  "voice_id": "voice_clone_xxxxx",
  "voice_name": "我的音色",
  "status": "completed",
  "created_at": 1234567890
}

코드 예시

import requests

# 步骤1:上传音频文件
upload_url = "https://your-proxy-domain.com/v1/files/upload"
headers = {"Authorization": "Bearer YOUR_API_KEY"}

files = {"file": open("voice_sample.mp3", "rb")}
data = {"purpose": "voice_clone"}
upload_resp = requests.post(upload_url, headers=headers, files=files, data=data)
file_id = upload_resp.json()["file_id"]

# 步骤2:克隆音色
clone_url = "https://your-proxy-domain.com/v1/voice_clone"
clone_data = {
    "file_id": file_id,
    "voice_name": "我的音色",
    "description": "基于示例音频克隆的音色"
}
clone_resp = requests.post(
    clone_url,
    headers={**headers, "Content-Type": "application/json"},
    json=clone_data
)
print(clone_resp.json())