Each developer account can create up to 10 audio files of 20 MB. Audio must use an 8000 Hz sample rate, 16-bit depth, and G.711 A-law encoding.
To protect Internet information security, creating audio later requires approval. The approval tool is not yet available.
Production: https://open.eye4cloud.com/{{open_id}}/open/v1/sound/set| Field Name | Required | Type | Description |
|---|---|---|---|
| url | Yes | string | Audio URL; make sure it is downloadable |
| type | Yes | int | Audio format. The default is 0, which means g711a at 8000 Hz and 16-bit; mp3, wav, and pcm formats are not yet supported. |
| position | Yes | int | Pass a value from 1 to 10. Do not pass 0 or a value greater than 10. |
| timestamp | Yes | int64 | Timestamp in seconds |
| nonce | Yes | string | Random string, 8-20 characters |
| sign | Yes | string | See "Sign Generation Examples" for the implementation details When generating sign, set data to: "url=${url}&type=${type}&position=${position}" |
| data | No | string | Device DATA; an empty string can be passed |
| imei | No | string | Device IMEI; an empty string can be passed |
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": "",
}'
| Field Name | Type | Description |
|---|---|---|
| error_code | int | Status code: 0 indicates success; other values indicate an error |
| error_message | string | Error message; success indicates a normal response |
| data | object | {} |
Example:
{
"error_code": 0,
"error_message": "success",
"error_tips": "",
"data": {}
}