Skip to main content

Speech to Text on SL2610-Series

Finish The Getting Started Guide First

Complete the Getting Started with SL2610 guide first. It covers setting up your board, cloning the examples, and creating the Python environment. Activate the environment with source .venv/bin/activate in each new terminal.

Speech to text, also called automatic speech recognition (ASR), converts spoken words into written text. It is the first step for voice assistants, captions and voice control.

This guide uses two models:

  • Moonshine, a speech-to-text model designed for efficient, low-latency, real-time use on edge devices. It runs on the Torq NPU.
  • Silero VAD (Voice Activity Detection), a small model that detects when someone is speaking, so the app only transcribes real speech.

Run Speech to Text on Astra​

Hardware​

Attach a USB microphone to the board. Connect from a PC using ADB or SSH, or connect a display and USB keyboard and open a terminal directly.

Install the example-specific dependencies, the PortAudio libraries for microphone input, and download the model:

cd speech_to_text
pip install -r requirements.txt
../setup/install_portaudio.sh
python setup_demo.py

Speech to Text on the edge​

python run_cli.py

Speak into the microphone. Use English phrases that are more than a few words but less than five seconds long. The app captures your speech and prints the text in the terminal.

By default Moonshine uses the DMA (dmabuf) allocator with device-backed I/O. To use the CPU allocator instead:

python run_cli.py --tda cpu

Models​

This tutorial uses the following pre-compiled model for the SL2610-Series. See the model page for details, performance and download links:

Browse all models on the Models page.

Python walkthrough​

run_cli.py records audio from the microphone, uses Silero VAD to find where each utterance starts and ends, and sends the audio to Moonshine on the NPU. The Moonshine inference and download code is shared in utils/moonshine/.

Review speech_to_text/run_cli.py to learn more.

Citations​

Explore other applications​