14 voice commands on a $15 Raspberry Pi Zero 2 W (no cloud, no ASR)
Why KWS instead of full ASR For most DIY voice-control projects, a full open-vocabulary ASR model is overkill. If you want to control a lamp, a slideshow, a media player, or a simple UI by voice, you do not need a model that can transcribe arbitrary speech. You need to reliably recognize 10 to 20 specific commands. That is the job of KWS (keyword spotting) , a separate class of models trained on…
The article provides a tutorial for using the KWS (keyword spotting) feature on a Raspberry Pi Zero 2 W, which costs $15 and has 1 GHz A53 processor. KWS is recommended over full ASR (automatic speech recognition) for voice control projects with a fixed set of commands, as it uses less computational power and offers faster processing.
The tutorial covers 14 specific commands grouped into categories such as confirmation and control, media playback, direction, switch, and wake-like commands. These commands cover basic functionalities like starting and pausing media playback, navigating UI elements, switching devices on/off, and triggering brand-specific phrases.
The hardware requirements include the Raspberry Pi Zero 2 W, a USB microphone, a MicroSD card with Raspberry Pi OS Lite, and an optional GPIO breadboard for hardware integration. The author emphasizes the importance of a quality USB microphone, as cheap single-element mics may struggle to recognize commands in noisy environments.
To set up the system, the article guides the reader through flashing the Raspberry Pi OS, configuring Wi-Fi and SSH access, and installing necessary system dependencies. The Python SDK, voxrt-kws, is installed along with PyAudio and a pre-trained KWS model file. The tutorial provides a simple "hello world" example that listens for user input and prints recognized commands along with their confidence scores.
The author notes that the Pi Zero 2 W is the optimal choice for this project due to its balance of cost and performance. The Pi Zero is too weak for real-time KWS processing, while higher-end models like Raspberry Pi 3, 4, and 5 are more expensive. The latency of the KWS system on the Pi Zero 2 W is around 150 milliseconds, which is acceptable for most voice-control applications. However, the author advises setting the input device index explicitly to avoid issues with PyAudio defaulting to the onboard audio.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.