2.3.2、播放音频

为了避免播放音频时才实时转码音频,需要提前在上一步将音频转码好。

POSThttps://open.eye4cloud.com/{{open_id}}/open/v1/sound/play
请求数据
字段名 是否必传 类型 备注
position 是 string 音频存放的位置
timestamp 是 int64 时间戳,单位:秒
nonce 是 string 随机字符串,8~20个字符
sign 是 string 具体实现方法,请参考《生成sign的示例代码》
生成sign时data字段传值为:"positon=${position}"
data 否 string 设备DATA,可传空字符串
imei 否 string 设备IMEI,可传空字符串
CURL请求示例
CURL
curl 'https://open.eye4cloud.com/{{open_id}}/open/v1/sound/play' \
  -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 {}

示例:

JSON
{
    "error_code": 0,
    "error_message": "success",
    "error_tips": "",
    "data": {}
}