7.3 Audio Playback Section
7.3 Audio Playback Section
7.3.1 Overview
The A2 Lite robot does not have a microphone and thus cannot perform voice interaction functions. However, it is equipped with a speaker that can play basic audio files and adjust volume. It also supports queue playback, playback status queries, and interruption control logic.
7.3.2 Audio File Playback RPC Interface
| Interface Name | pb:/aimdk.protocol.TTSService/PlayMediaFile |
|---|---|
| Function Summary | Audio file playback |
| Interface Type | HTTP JSON RPC |
| URL | http://127.0.0.1:59201/rpc/aimdk.protocol.TTSService/PlayMediaFile |
| Input Parameters | text
|
| Output Parameters | text
|
| Example Script | examples/audio/play_media_file.sh |
| Notes |
|
7.3.3 Audio File Playback Status Query RPC Interface
| Interface Name | pb:/aimdk.protocol.TTSService/GetAudioStatus |
|---|---|
| Function Summary | Audio file playback status query |
| Interface Type | HTTP JSON RPC |
| URL | http://127.0.0.1:59201/rpc/aimdk.protocol.TTSService/GetAudioStatus |
| Input Parameters | text
|
| Output Parameters | text
|
| Example Script | examples/audio/get_audio_status.sh |
| Notes | A successful playback queried through this RPC interface generally returns InQue, Playing, and NOTInQue states |
7.3.4 Audio File Playback Interruption RPC Interface
We provide interfaces for interrupting a single file playback and clearing the entire playback queue.
| Interface Name | pb:/aimdk.protocol.TTSService/StopTTSTraceId |
|---|---|
| Function Summary | Interrupt a single file playback |
| Interface Type | HTTP JSON RPC |
| URL | http://127.0.0.1:59201/rpc/aimdk.protocol.TTSService/StopTTSTraceId |
| Input Parameters | text
|
| Output Parameters | text
|
| Example Script | examples/audio/stop_trace_id.sh |
| Notes |
| Interface Name | pb:/aimdk.protocol.TTSService/StopTTS |
|---|---|
| Function Summary | Terminate all audio file playback, including the current playback task and all tasks in the queue |
| Interface Type | HTTP JSON RPC |
| URL | http://127.0.0.1:59201/rpc/aimdk.protocol.TTSService/StopTTS |
| Input Parameters | text
|
| Output Parameters | text
|
| Example Script | examples/audio/stop_all.sh |
| Notes |
7.3.5 Volume Get and Set RPC Interfaces
| Interface Name | pb:/aimdk.protocol.HalAudioService/GetAudioVolume |
|---|---|
| Function Summary | Get the current volume level |
| Interface Type | HTTP JSON RPC |
| URL | http://127.0.0.1:59201/rpc/aimdk.protocol.HalAudioService/GetAudioVolume |
| Input Parameters | text |
| Output Parameters | text
|
| Example Script | examples/audio/get_audio_volume.sh |
| Notes |
| Interface Name | pb:/aimdk.protocol.HalAudioService/SetAudioVolume |
|---|---|
| Function Summary | Adjust the volume |
| Interface Type | HTTP JSON RPC |
| URL | http://127.0.0.1:59201/rpc/aimdk.protocol.HalAudioService/SetAudioVolume |
| Input Parameters | text
|
| Output Parameters | text
|
| Example Script | examples/audio/set_audio_volume.sh |
| Notes |