声纹验证接口
更新时间:
验证声纹相似度并返回匹配信息。
POSThttps://asr.ilivedata.com/api/v1/isv/detect
请求参数
请求头
以下请求头均为必需。
Header
值
说明
Content-Type
application/json; charset=UTF-8
请求体格式
Accept
application/json; charset=UTF-8
响应格式
X-AppId
—
控制台「服务配置」中的项目编号
X-TimeStamp
—
请求发起时的 UTC 时间,采用 W3C 格式。
格式示例:2026-09-30T02:30:00Z,实际请求需使用当前时间。
Authorization
—
签名值,计算方式见下文「请求签名」
请求体
参数
类型
必需
说明
url
String
必需
音频url
referUrl
String
可选
对比音频url
searchFeaRes
Boolean
可选
返回匹配度音频开关。 备注:当前音频注册需要提供线下数据,featureId跟URL(需唯一对应)
feaScore
Float
可选
匹配度阈值,默认0.8
请求示例
{
"url": "https://example.com/test.mp3",
"referUrl": "https://example.com/test1.mp3",
"searchFeaRes": true,
"feaScore": 0.8
}
请求签名
按照帮助中心的请求签名计算 Authorization,使用以下接口参数。
签名参数
值
HTTPMethod
POST
HostHeaderInLowercase
asr.ilivedata.com
HTTPRequestURI
/api/v1/isv/detect
HTTP 响应
Content-Type: application/json;charset=UTF-8
响应字段
字段
类型
说明
errorCode
Number
errorCode码
errorMessage
String
错误消息
taskId
String
任务Id
result
Detail
结果
Detail
字段
类型
说明
audioEmbedding
Array
url对应向量(192维向量)
referAudioEmbedding
Array
referUrl对应向量(192维向量)
similarity
Float
相似度
searchFeaRes
FeatureDetail
相似度音频列表
FeatureDetail
字段
类型
说明
featureId
String
音频特征Id
score
Float
相似度得分
响应示例
以下向量示例省略了部分元素。
{
"errorCode": 0,
"errorMessage": "OK",
"taskId": "f7919cf1a5fc4f32a5d3fe576655416a",
"results": {
"audioEmbedding": [0.25756836,...,2.31054688],
"referAudioEmbedding": [1.41992188,...,0.07128906],
"similarity": 0.5,
"searchFeaRes": [
{
"featureId": "voice_1",
"score": 0.9995
},
{
"featureId": "voice_2",
"score": 0.6885
},
{
"featureId": "voice_3",
"score": 0.5679
}
]
}
}
错误码
HTTP 状态码
错误码
错误消息
200
0
此字段省略
405
1004
Method Not Allowed
411
1007
Not Content Length
400
1002
API Not Found
400
1003
Bad Request
400
2000
Missing Parameter
400
2001
Invalid Parameter
400
2002
Invalid Request
400
2102
Input Too Long
400
2103
Detection Failed
400
2109
Speech Recognition Failed
400
2110
File is invalid
400
2111
Failed to download file
400
2112
TaskId is invalid
401
1102
Unauthorized Client
401
1106
Missing Access Token
401
1107
Invalid Token
401
1108
Expired Token
401
1110
Invalid Client
验证声纹相似度并返回匹配信息。
POST
https://asr.ilivedata.com/api/v1/isv/detect请求参数
请求头
以下请求头均为必需。
| Header | 值 | 说明 |
|---|---|---|
Content-Type |
application/json; charset=UTF-8 |
请求体格式 |
Accept |
application/json; charset=UTF-8 |
响应格式 |
X-AppId |
— | 控制台「服务配置」中的项目编号 |
X-TimeStamp |
— | 请求发起时的 UTC 时间,采用 W3C 格式。 格式示例: 2026-09-30T02:30:00Z,实际请求需使用当前时间。 |
Authorization |
— | 签名值,计算方式见下文「请求签名」 |
请求体
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
url |
String |
必需 | 音频url |
referUrl |
String |
可选 | 对比音频url |
searchFeaRes |
Boolean |
可选 | 返回匹配度音频开关。 备注:当前音频注册需要提供线下数据,featureId跟URL(需唯一对应) |
feaScore |
Float |
可选 | 匹配度阈值,默认0.8 |
请求示例
{
"url": "https://example.com/test.mp3",
"referUrl": "https://example.com/test1.mp3",
"searchFeaRes": true,
"feaScore": 0.8
}
请求签名
按照帮助中心的请求签名计算 Authorization,使用以下接口参数。
| 签名参数 | 值 |
|---|---|
HTTPMethod |
POST |
HostHeaderInLowercase |
asr.ilivedata.com |
HTTPRequestURI |
/api/v1/isv/detect |
HTTP 响应
Content-Type: application/json;charset=UTF-8
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
errorCode |
Number |
errorCode码 |
errorMessage |
String |
错误消息 |
taskId |
String |
任务Id |
result |
Detail |
结果 |
Detail
| 字段 | 类型 | 说明 |
|---|---|---|
audioEmbedding |
Array |
url对应向量(192维向量) |
referAudioEmbedding |
Array |
referUrl对应向量(192维向量) |
similarity |
Float |
相似度 |
searchFeaRes |
FeatureDetail |
相似度音频列表 |
FeatureDetail
| 字段 | 类型 | 说明 |
|---|---|---|
featureId |
String |
音频特征Id |
score |
Float |
相似度得分 |
响应示例
以下向量示例省略了部分元素。
{
"errorCode": 0,
"errorMessage": "OK",
"taskId": "f7919cf1a5fc4f32a5d3fe576655416a",
"results": {
"audioEmbedding": [0.25756836,...,2.31054688],
"referAudioEmbedding": [1.41992188,...,0.07128906],
"similarity": 0.5,
"searchFeaRes": [
{
"featureId": "voice_1",
"score": 0.9995
},
{
"featureId": "voice_2",
"score": 0.6885
},
{
"featureId": "voice_3",
"score": 0.5679
}
]
}
}
错误码
| HTTP 状态码 | 错误码 | 错误消息 |
|---|---|---|
| 200 | 0 | 此字段省略 |
| 405 | 1004 | Method Not Allowed |
| 411 | 1007 | Not Content Length |
| 400 | 1002 | API Not Found |
| 400 | 1003 | Bad Request |
| 400 | 2000 | Missing Parameter |
| 400 | 2001 | Invalid Parameter |
| 400 | 2002 | Invalid Request |
| 400 | 2102 | Input Too Long |
| 400 | 2103 | Detection Failed |
| 400 | 2109 | Speech Recognition Failed |
| 400 | 2110 | File is invalid |
| 400 | 2111 | Failed to download file |
| 400 | 2112 | TaskId is invalid |
| 401 | 1102 | Unauthorized Client |
| 401 | 1106 | Missing Access Token |
| 401 | 1107 | Invalid Token |
| 401 | 1108 | Expired Token |
| 401 | 1110 | Invalid Client |