Welcome to ROSMASTER M3 repository
10.Core module testing tools
Core Module Testing Tools
Core Module Testing Tools1. Course Content2. Start the Dify service3. Navigate to the test tool path4. Test Local Speech Synthesis Functionality5. Test Local Speech Recognition Functionality6. Testing Robot Access to Dify7. Online Voice Service for International Users7.1 iFlytek Speech Recognition Service7.2 iFlytek Speech Synthesis Service
1. Course Content
- multi_brains provides minimal test programs for testing the core modules of a large model, used to quickly locate problems in abnormal situations.
2. Start the Dify service

3. Navigate to the test tool path
For Raspberry Pi 5 users, if the ROS container is not running, you need to start it first.
bringup_m3
Open a terminal inside the container.
xxxxxxxxxxexec_m3
xxxxxxxxxxcd ~/yahboomM3_ws/code_ws/src/multi_brains/testls
- The test tools are as follows:

4. Test Local Speech Synthesis Functionality
Only ORIN Mainboard
- Test local speech synthesis functionality for Chinese and English in sequence.
xxxxxxxxxxpython3 test_PiperTTS.py
After running, the speech synthesis results for Chinese and English will be played sequentially.

5. Test Local Speech Recognition Functionality
Only ORIN Mainboard
- After running, test preset Chinese and English audio recordings sequentially.
xxxxxxxxxxpython3 test_SenseVoiceSmall.py
After running, the speech recognition results for the test audio will be printed.

6. Testing Robot Access to Dify
- When the program displays "Model service unavailable," and it's unclear whether the robot's inability to access Dify is due to an incorrect network address, you can test:
xxxxxxxxxxpython3 test_dify_connection.py
If the robot displays the following information normally, it proves that the robot's connection to Dify is normal. Otherwise, it may be that Dify is not started or the Dify program has crashed and needs to be restarted.

7. Online Voice Service for International Users
7.1 iFlytek Speech Recognition Service
- If online speech recognition encounters errors, you can test iFlytek's speech recognition service separately.
xxxxxxxxxxpython3 test_xunfeiASR.py
- After running, it will perform speech recognition tests on the preset test audio.

7.2 iFlytek Speech Synthesis Service
- If online speech synthesis encounters errors, you can test iFlytek's speech recognition service separately.
xxxxxxxxxxpython3 test_xunfeiTTS.py
After running, it will first perform speech synthesis on the default text, and then play the corresponding audio.
