Last Updated on : 2024-06-04 10:11:49download
This topic describes the commands for the audio service.
The MCU sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x72 |
Data length | 2 | 0x0003 |
Data | 3 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x72 |
Data length | 2 | 0x0003 |
Data | 3 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
An SD card support is required to implement this feature.
The MCU sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x71 |
Data length | 2 | 0x0004 + N |
Data | 4 + N |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x71 |
Data length | 2 | 0x0005 |
Data | 5 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x71 |
Data length | 2 | 0x0001 |
Data | 1 | Subcommand: 0x28 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x71 |
Data length | 2 | 0x0003 |
Data | 3 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module reports the completion status when local music playback is finished.
The module sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x71 |
Data length | 2 | 0x0002 |
Data | 2 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x72 |
Data length | 2 | 0x0003 |
Data | 3 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x72 |
Data length | 2 | 0x0003 |
Data | 3 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x71 |
Data length | 2 | 0x0002 |
Data | 2 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
opt
: indicates the mode. Valid values: play
and query
.
play
: The cellular module plays the audio directly after receiving it.
timeout
: The timeout for receiving the audio from the cloud. The audio playback time is excluded. The timeout defaults to 10s and must be at least 5 seconds.query
: Query the current status of TTS playback. When query
is selected, context
and timeout
fields can be left empty.
The module returns the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x71 |
Data length | 2 | 2 |
Data | 2 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Result | Meaning |
---|---|
-7 | The TTS server is not connected. |
-6 | Incorrect parameter. |
-5 | Text encoding error. |
-4 | Network error. |
-3 | Device is busy. |
-2 | Failure. |
-1 | Timeout. |
0 | Success. |
1 | TTS service is idle. |
2 | TTS information is obtained. |
3 | TTS audio is being requested. |
4 | TTS audio is downloading. |
5 | TTS audio is playing. |
6 | Failed to request TTS audio. |
7 | Failed to download TTS audio. |
8 | TTS request timed out. |
9 | TTS audio finishes playing. |
Transfer and control audio data stored in the memory. The module supports up to four audio IDs, with a maximum of 16 KB per audio ID.
The audio data is stored in the memory of the module, which gets lost when the device is restarted. Therefore, the MCU should transfer the memory data to the module again.
To add audio data, the length of an audio data packet should not exceed 1024 bytes.
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x71 |
Data length | 2 |
|
Data | Data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Command
Command | Combined content |
---|---|
1 | Audio ID, audio format, total_size , offset , and audio data |
2 | Audio ID |
3 | Audio ID and port |
4 | Audio ID |
5 | None |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x71 |
Data length | 2 | 0x0004/0x0005 |
Data | 4/5 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Status value | Meaning |
---|---|
0 | Success |
1 | The upper limit of 16 KB is exceeded. |
2 | Audio ID is busy. |
3 | The maximum number of audio IDs is reached. |
4 | The audio ID does not exist. |
5 | The data of the audio ID is incomplete. |
6 | Audio device is busy. |
7 | Failed to play the audio ID. |
8 | The size of a single packet exceeds 1024 bytes. |
Example
Play the audio ID: 55 AA 03 71 00 04 49 03 01 00 C
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback