SenseAudio 音色克隆
curl --request POST \
--url https://api.senseaudio.cn/v1/voice/clone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"file_id": "<string>",
"model": "sensenova-tts-2.0-clone",
"text": "<string>",
"label": "<string>"
}
'import requests
url = "https://api.senseaudio.cn/v1/voice/clone"
payload = {
"description": "<string>",
"file_id": "<string>",
"model": "sensenova-tts-2.0-clone",
"text": "<string>",
"label": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
file_id: '<string>',
model: 'sensenova-tts-2.0-clone',
text: '<string>',
label: '<string>'
})
};
fetch('https://api.senseaudio.cn/v1/voice/clone', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.senseaudio.cn/v1/voice/clone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'file_id' => '<string>',
'model' => 'sensenova-tts-2.0-clone',
'text' => '<string>',
'label' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.senseaudio.cn/v1/voice/clone"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"file_id\": \"<string>\",\n \"model\": \"sensenova-tts-2.0-clone\",\n \"text\": \"<string>\",\n \"label\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.senseaudio.cn/v1/voice/clone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"file_id\": \"<string>\",\n \"model\": \"sensenova-tts-2.0-clone\",\n \"text\": \"<string>\",\n \"label\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.senseaudio.cn/v1/voice/clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"file_id\": \"<string>\",\n \"model\": \"sensenova-tts-2.0-clone\",\n \"text\": \"<string>\",\n \"label\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"label": "<string>",
"name": "<string>",
"description": "<string>",
"created_at": 123,
"demo": "<string>"
}音色
SenseAudio 音色克隆
POST
/
v1
/
voice
/
clone
SenseAudio 音色克隆
curl --request POST \
--url https://api.senseaudio.cn/v1/voice/clone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"file_id": "<string>",
"model": "sensenova-tts-2.0-clone",
"text": "<string>",
"label": "<string>"
}
'import requests
url = "https://api.senseaudio.cn/v1/voice/clone"
payload = {
"description": "<string>",
"file_id": "<string>",
"model": "sensenova-tts-2.0-clone",
"text": "<string>",
"label": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
file_id: '<string>',
model: 'sensenova-tts-2.0-clone',
text: '<string>',
label: '<string>'
})
};
fetch('https://api.senseaudio.cn/v1/voice/clone', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.senseaudio.cn/v1/voice/clone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'file_id' => '<string>',
'model' => 'sensenova-tts-2.0-clone',
'text' => '<string>',
'label' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.senseaudio.cn/v1/voice/clone"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"file_id\": \"<string>\",\n \"model\": \"sensenova-tts-2.0-clone\",\n \"text\": \"<string>\",\n \"label\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.senseaudio.cn/v1/voice/clone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"file_id\": \"<string>\",\n \"model\": \"sensenova-tts-2.0-clone\",\n \"text\": \"<string>\",\n \"label\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.senseaudio.cn/v1/voice/clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"file_id\": \"<string>\",\n \"model\": \"sensenova-tts-2.0-clone\",\n \"text\": \"<string>\",\n \"label\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"label": "<string>",
"name": "<string>",
"description": "<string>",
"created_at": 123,
"demo": "<string>"
}说明
使用已上传的参考音频生成克隆音色。调用前请先通过 上传文件 获取file_id。
- 生成链路:上传音频获取
file_id→ 调用本接口生成音色 ID → 在 TTS 接口中使用该音色。 - 音色 ID:本接口使用
label作为自定义音色 ID,生成后在voice_setting.voice_id中传入该label。 - 克隆模型:当前使用
sensenova-tts-2.0-clone。
调用示例
1. 上传参考音频
curl -X POST https://api.senseaudio.cn/v1/files/upload \
-H "Authorization: <API_KEY>" \
-F "purpose=voice_clone" \
-F "file=@/path/to/voice.wav"
file.file_id:
{
"file": {
"file_id": "file-KQGDEegFNcaWhpNWdoiPZj",
"filename": "voice.wav",
"bytes": 228778,
"purpose": "voice_clone"
}
}
2. 生成克隆音色
curl --request POST \
--url https://api.senseaudio.cn/v1/voice/clone \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"description": "温柔御姐,普通话,语气自然",
"file_id": "file-KQGDEegFNcaWhpNWdoiPZj",
"model": "sensenova-tts-2.0-clone",
"text": "你好,这是我的克隆音色试听。",
"label": "wenrou_yujie_001"
}'
使用克隆音色
生成成功后,将label 作为 voice_setting.voice_id 传入 语音合成 HTTP:
{
"model": "sensenova-tts-2.0",
"text": "你好,这是使用克隆音色生成的音频。",
"voice_setting": {
"voice_id": "wenrou_yujie_001"
}
}
与 Minimax 兼容接口的区别
| 项目 | SenseAudio 音色克隆 | Minimax 兼容音色克隆 |
|---|---|---|
| 路径 | /v1/voice/clone | /v1/voice_clone |
| 音色 ID 字段 | label | voice_id |
| 音色描述 | 支持 description | 不包含 description |
| 生成后使用方式 | voice_setting.voice_id = label | voice_setting.voice_id = voice_id |
授权
格式:Bearer <API_KEY>
请求体
application/json
⌘I