Voice API test¶
- async test.test_sound.test_play_tts()[source]¶
Test play tts
Make the robot start playing a tts, the content is “Hello, I am Alphamini, la la la”, and wait for the result
#ControlTTSResponse.isSuccess: Is it successful
#ControlTTSResponse.resultCode: Return code
- async test.test_sound.test_stop_play_tts()[source]¶
Test stop playing tts
Make the robot start to play a long text tts, the content is “Hello, I am Alphamini, la la la la la la la la la la la la la la la la la la la la la la la”, do not wait result After 2s, make the robot stop playing tts
#ControlTTSResponse.isSuccess: Is it successful
#ControlTTSResponse.resultCode: Return code
- async test.test_sound.test_play_online_audio()[source]¶
Test playing online sound
Make the robot play an online sound effect, such as “http://hao.haolingsheng.com/ring/000/995/52513bb6a4546b8822c89034afb8bacb.mp3”
Supported formats are mp3, amr, wav, etc.
And wait for the result
#PlayAudioResponse.isSuccess: Is it successful
#PlayAudioResponse.resultCode: Return code
- async test.test_sound.test_play_local_audio()[source]¶
Test playing local sound
Make the robot play a local built-in sound effect, the sound effect name is “read_016”, and wait for the result
#PlayAudioResponse.isSuccess: Is it successful
#PlayAudioResponse.resultCode: Return code
- async test.test_sound.test_get_audio_list()[source]¶
Test to get a list of sound effects
Get the list of sound effects built into the robot and wait for the result
#GetAudioListResponse.audio ([Audio]): Audio effect list
#Audio.name: Audio effect name
#Audio.suffix: audio suffix
#GetAudioListResponse.isSuccess: Is it successful
#GetAudioListResponse.resultCode: Return code
- async test.test_sound.test_stop_audio_tts()[source]¶
Test stop all audio being played
Play a period of tts first, after 3s, stop all sound effects, and wait for the result
#StopAudioResponse.isSuccess: Is it successful
#StopAudioResponse.resultCode: Return code