每个开发者账号支持创建最多10个20M的音频,需提供采样率为8000HZ,16bit,g711alaw的音频。
为保障互联网信息安全,后续创建音频需要审批,审批工具待提供。
https://open.eye4cloud.com/{{open_id}}/open/v1/sound/set| 字段名 | 是否必传 | 类型 | 备注 |
|---|---|---|---|
| url | 是 | string | 音频地址,需保证可以下载 |
| type | 是 | int | 音频格式,默认值为0,表示 g711a 采样率8000hz 16bit mp3 wav pcm 等格式待支持 |
| position | 是 | int | 传值为 1 ~ 10。不可传0或大于10的数字。 |
| timestamp | 是 | int64 | 时间戳,单位:秒 |
| nonce | 是 | string | 随机字符串,8~20个字符 |
| sign | 是 | string | 具体实现方法,请参考《生成sign的示例代码》 生成sign时data字段传值为:"url=${url}&type=${type}&position=${position}" |
| data | 否 | string | 设备DATA,可传空字符串 |
| imei | 否 | string | 设备IMEI,可传空字符串 |
curl 'https://open.eye4cloud.com/{{open_id}}/open/v1/sound/set' \
-H 'Content-Type: application/json' \
--data-raw '{
"url": "xxx",
"type": "xxx",
"position": "xxx",
"timestamp": 1757472185,
"nonce": "",
"sign": "",
}'
| 字段名 | 类型 | 备注 |
|---|---|---|
| error_code | int | 状态码:0正常,其他异常 |
| error_message | string | 错误信息:正常为success |
| data | object | {} |
示例:
{
"error_code": 0,
"error_message": "success",
"error_tips": "",
"data": {}
}