获取:默认voice 列表
获取数字人默认 voice 列表,用于选择已有声音进行数字人视频生成。
概览
- 请求方法:
GET - 请求路径:
/avatar/voice - 内容类型:
application/json - 分类:视频模型(Video)/数字人
认证方式
- Header:
Authorization: Bearer <token>
请求参数
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| language | string | 否 | 语言过滤,支持 en、zh |
请求示例
curl 示例
bash
curl -X GET "https://api.gpt.ge/avatar/voice?language=zh" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_TOKEN"JavaScript (fetch) 示例
javascript
fetch('https://api.gpt.ge/avatar/voice?language=zh', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
})
.then(res => res.json())
.then(console.log)Python 示例(requests)
python
import requests
resp = requests.get(
'https://api.gpt.ge/avatar/voice?language=zh',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
)
print(resp.json())返回字段说明
| 字段 | 类型 | 描述 |
|---|---|---|
| code | string | 接口返回状态 |
| data | object | 返回数据对象 |
| data.audio_list | array | voice 列表 |
| data.audio_list[].audio_id | string | voice ID |
| data.audio_list[].audio_url | string | voice URL |
| data.audio_list[].labels | array[string] | voice 标签列表 |
| data.audio_list[].language | string | 语言 |
| data.audio_list[].name | string | voice 名称 |
| data.audio_list[].vip_enable | boolean | 是否 VIP |
| data.audio_list[].voice_engine_id | string | 语音引擎 ID |
| data.audio_list[].type | string | voice 类型 |
| message | string | 返回信息 |
返回示例(200)
json
{
"code": "success",
"data": {
"audio_list": [
{
"audio_id": "cffcff22110049a487aa4fa7a382e3dc",
"audio_url": "server/ranker/main/d5f86550f71f4b968e1bd431364fffb9.wav",
"labels": ["Female"],
"language": "zh",
"name": "Yue Hua",
"vip_enable": false,
"voice_engine_id": "yuexiaohua"
},
{
"audio_id": "e5d50afcd63446129bfc547635c9ccf9",
"audio_url": "https://s3.amazonaws.com/pt-tts-new/oneshot_tts_result/20241212/_/4802465.wav",
"labels": ["Male"],
"language": "zh",
"name": "Santa Claus-B",
"type": "small",
"vip_enable": false,
"voice_engine_id": "x1_santa_claus_1"
}
]
},
"message": ""
}