Welcome to Jetson AGX Thor repository
18.OpenClaw Voice Assistant
Openclaw Voice Assistant
Openclaw Voice Assistant1. Function Overview2. Hardware Connection3. Environment Setup4. Modify Program Configuration5. Enabling HTTP Functionality in OpenClaw6. Running the Program and Demonstration
1. Function Overview
The Openclaw voice assistant uses a speech module to capture sound, converts the sound into text, sends it to Openclaw, receives Openclaw's responses, and finally converts the responses back into audio for playback.
The speech-to-text and text-to-speech functions use the qwen3-asr-flash and qwen3-tts-flash models from Tongyi Qianwen, so you need to fill in the Alibaba Cloud Bailian Platform API_KEY to use it.
Openclaw needs to be configured in advance, either online or offline.
2. Hardware Connection
This example requires connecting not only the power adapter but also the large language model module for language input and output, and a DP monitor, mouse, and keyboard for displaying the interface and performing operations, or logging into a remote desktop.

3. Environment Setup
The factory image has been successfully set up.
Open the terminal, transfer the voice_to_openclaw.zip file from the program source code collection to the motherboard's user directory and extract it.
xxxxxxxxxxUnzip voice_to_openclaw.zip
Run the following command to create a new Python virtual environment
xxxxxxxxxxcd ~/voice_to_openclawpython -m venv .venvsource .venv/bin/activate

Install the relevant Python dependencies
xxxxxxxxxxpip install -r requirements.txt

4. Modify Program Configuration
Open the terminal, copy the example configuration as the valid configuration. The program will read the configuration parameters in the .env file when it runs.
xxxxxxxxxxcd ~/voice_to_openclawcp env.example .env
Open the .env file:
xxxxxxxxxxvim .env
You must fill in the value for DASHSCOPE_API_KEY; this value corresponds to your API Key for Tongyi Qianwen. For detailed instructions on how to obtain this key, please refer to the course section: [Online AI Large Model Development] -> [Online Large Models (Text Interaction)] -> [Tongyi Qianwen Large Model] to look up the information or register.
xxxxxxxxxxDASHSCOPE_API_KEY=

The following are optional configurations:
- If you wish to switch to English conversation, change the value of the
DASHSCOPE_LANGUAGEparameter toen.
xxxxxxxxxxDASHSCOPE_LANGUAGE=en
- If you wish to change the Speech-to-Text (ASR) model, modify the value of the
DASHSCOPE_ASR_MODELparameter.
xxxxxxxxxxDASHSCOPE_ASR_MODEL=qwen3-asr-flash
- If you wish to change the Text-to-Speech (TTS) model, modify the value of the
DASHSCOPE_TTS_MODELparameter.
xxxxxxxxxxDASHSCOPE_TTS_MODEL=qwen3-tts-flash
- If you wish to change the TTS speaker (voice timbre), modify the value of the
DASHSCOPE_TTS_VOICEparameter.
xxxxxxxxxxDASHSCOPE_TTS_VOICE=Cherry
The available voice options on the Tongyi Qianwen platform can be found and previewed at the following link:
xxxxxxxxxxhttps://help.aliyun.com/zh/model-studio/qwen-tts?mode=pure#bac280ddf5a1u
- If you wish to change the acknowledgment phrase spoken after the voice wake-up command is detected, modify the value of the
WAKE_ACK_TEXTparameter. Additionally, delete theack_tts.wavfile; a newack_tts.wavfile will be automatically generated the next time you run the program. If you do not require a spoken response after the wake-up command, simply leave theWAKE_ACK_TEXTparameter blank.
xxxxxxxxxxWAKE_ACK_TEXT=I'm here.
xxxxxxxxxxrm ~/voice_to_openclaw/ack_tts.wav
- If you need to adjust the ambient noise filtering level, please modify the value of the
AGGRESSIVENESSparameter. The valid range is [0, 1, 2, 3]; a higher value is suitable for environments with higher noise levels.
xxxxxxxxxxAGGRESSIVENESS=2
- If you need to adjust the silence timeout duration that triggers the end of recording, please modify the value of the
MAX_SILENCE_MSparameter. The unit is milliseconds; by default, 2 seconds of silence signals the end of the recording.
xxxxxxxxxxMAX_SILENCE_MS=2000
- If you need to adjust the maximum recording duration (recording timeout), please modify the value of the
MAX_UTTERANCE_MSparameter. The unit is milliseconds; by default, recording automatically ends 5 seconds after the wake-up command is detected.
xxxxxxxxxxMAX_UTTERANCE_MS=5000
- If you need to adjust the timeout duration for OpenClaw, please modify the value of the
OPENCLAW_TIMEOUTparameter. The unit is seconds; the default timeout is 3 minutes.
xxxxxxxxxxOPENCLAW_TIMEOUT=180
- If you are not using the factory-provided system image, the system may not have the voice module port bound to
/dev/myserial. In this case, please modify theMIC_SERIAL_PORTparameter to reflect the actual USB port name (e.g.,/dev/ttyUSB0).
xxxxxxxxxxMIC_SERIAL_PORT=/dev/ttyUSB0
5. Enabling HTTP Functionality in OpenClaw
Since OpenClaw's HTTP functionality is disabled by default, you must add an HTTP enablement configuration to the OpenClaw settings to use it. If you have already added the HTTP enablement configuration, you may skip this step.
Open a terminal and run the following command to edit the openclaw.json file:
xxxxxxxxxxvim ~/.openclaw/openclaw.json
Search for [gateway]. If the gateway object does not contain an HTTP enablement configuration, add the necessary configuration settings within the gateway object. Then, save the configuration file.
xxxxxxxxxx"http": {"endpoints": {"chatCompletions": {"enabled": true}}},

Restart the OpenClaw gateway to apply the configuration changes.
xxxxxxxxxxopenclaw gateway restart
6. Running the Program and Demonstration
Open a terminal and activate the virtual environment:
xxxxxxxxxxcd ~/voice_to_openclawsource .venv/bin/activate
Run the program:
xxxxxxxxxxpython -m src.main

Say "Hi,yahboom" to wake up the device. Once awakened, the device will respond, "I'm here." At this point, the device begins recording. (The terminal will print "1" to indicate an active speaking state, or "-" to indicate a silent state. By default, recording automatically ends after 2 seconds of silence, or if the total recording duration exceeds the default maximum limit of 6 seconds.)
Then, state the command you want OpenClaw to execute—for example: "Tell me a joke."
Once the recording is complete, the ASR (Automatic Speech Recognition) module converts the audio into text and sends it to OpenClaw. After receiving a response from OpenClaw, the TTS (Text-to-Speech) module converts the content back into audio and plays it aloud.
Note: While audio content is being played back, you can interrupt the playback and issue a new command by saying "Hi,yahboom" to wake the device again.