QuecPython has launched an AI chat solution based on Doubao Websocket. This solution implements voice dialogue based on Volcengine Websocket interface.
The module models that support this feature are as follows:
| Series | Model |
|---|---|
| EC800M | EC800MCN_LE |
-
Supports voice question and answer (one question one answer).
-
Supports independent ASR (Automatic Speech Recognition).
-
Supports independent TTS (Text-to-Speech) playback.
-
Supports independent large language model.
-
Written in Python language, facilitating secondary development.
Before you begin, please ensure you have the following prerequisites:
-
Hardware:
-
EC800MCNLE QuecDuino Development Board (including antenna, Type-C data cable, etc.)
-
Computer (Windows 7, Windows 10, or Windows 11)
-
Speaker
-
Any speaker with 2-5W power is sufficient
-
-
-
Software:
-
USB driver for QuecPython module: QuecPython_USB_Driver_Win10_ASR
-
Debugging tool QPYcom
-
QuecPython firmware (firmware included in the fw folder)
-
-
Clone the repository:
git clone https://github.com/QuecPython/AIChatBot-Volcengine-websocket.git cd AIChatBot-Volcengine-websocket -
Install USB driver
-
Flash firmware: Flash the firmware to the development board according to the instructions.
Before use, please update Volcengine token and other parameters through the
tiktok.configinterface first.
- Connect the hardware: Connect the hardware according to the following diagram:
1. Connect the speaker to the pin headers marked `SPK+` and `SPK-` in the diagram.
2. Insert an available Nano SIM card in the position shown.
3. Connect the antenna to the antenna connector marked `LTE`.
4. Use a Type-C data cable to connect the development board and the computer.
-
Download code to the device:
-
Launch the QPYcom debugging tool.
-
Connect the data cable to the computer.
-
Press the PWRKEY button on the development board to start the device.
-
Import all files in the
codefolder into the module file system according to the instructions, preserving the directory structure.
-
Note: If you need to improve the microphone sensitivity and avoid speech recognition errors, please import the
audio_gain.nvmandaudio_ve.nvmfiles under the nvm folder into the/usrdirectory of the module file system.
-
Run the application:
-
Update parameters through the
TiktokWS.configmethod. -
Select the
Filetab. -
Select the
tiktok_websocket_demo.pyscript. -
Right-click and select
Runor use theRunshortcut button to execute the script.
-
-
Reference runtime logs:
>>>from usr.tiktokws import TiktokWS
>>>tiktok=TiktokWS()
>>>tiktok.config(ModelId='ep-20250108223254-x4r5r')
True
# Select tiktok_websocket_demo.py script and right-click to run
>>>example.exec('/usr/tiktok_websocket_demo.py')
ai start success...
please press KEY S2 to start
# Press and hold KEY S2 to start speaking
>>> please speak to ai.
# Release KEY S2 to stop speaking, then the speaker plays the response audio
speak over and wait ai response.solution-AI/
├── code/
│ ├── ark_lib.py
│ ├── asr_lib.py
│ ├── logging.py
│ ├── ...
│ └── uwebsocket.py
├── media/
│ └── wire_connection.jpg
├── fw/
│ └── EC800MCNLER06A01M08_OCPU_QPY_TEST0228.zip
├── LICENSE
└── readme.md
We welcome contributions to improve this project! Please follow these steps to contribute:
-
Fork this repository.
-
Create a new branch (
git checkout -b feature/your-feature). -
Commit your changes (
git commit -m 'Add your feature'). -
Push to the branch (
git push origin feature/your-feature). -
Open a Pull Request.
This project uses the Apache license. See the LICENSE file for details.
If you have any questions or need support, please refer to the QuecPython Documentation or open an issue in this repository.
