Picovoice Alternative for Python: Run an Offline ONNX Wake Word
Picovoice no longer offers a continuing personal or non-commercial plan. This guide replaces the AccessKey-dependent runtime with a standard ONNX model and an open-source Python inference engine.
What changes when you migrate?
| Porcupine workflow | Open ONNX workflow |
|---|---|
| Initialize the SDK with an AccessKey | Load local model files directly |
Use a platform-specific .ppn | Use a standard ONNX model across desktop systems |
| Use the vendor runtime | Use ONNX Runtime plus open inference code |
Prerequisites
- Python 3.9 or newer
- A 16 kHz-capable microphone
- Linux, Windows, or macOS
- A Voicute model package or a demo model from the repository
Download the inference engine
git clone https://github.com/voicute/onnx-wakeword.git
cd onnx-wakeword
python -m venv .venvActivate the environment with .venv\Scripts\activate on Windows, or source .venv/bin/activate on Linux and macOS.
Install the desktop dependencies
pip install onnxruntime numpy pyaudioPyAudio may require the operating system's PortAudio package. On Debian or Ubuntu, install portaudio19-dev first. On macOS, install PortAudio with Homebrew if pip cannot build PyAudio.
Put the model files in one directory
The runtime needs a keyword model, model_info.json, and the supplied melspectrogram.onnx feature extractor. Keep the paths explicit while testing.
Start live detection
from python.wakeword_engine import WakeWordEngine
engine = WakeWordEngine()
engine.load("models/model_info.json", "models/melspectrogram.onnx")
engine.set_L1(True)
engine.start(lambda word, probability, info:
print(f"Detected: {word} ({probability:.0%})"))Say the trained phrase several times at a normal distance. A successful run prints the keyword and its probability without sending audio to a server.
Troubleshooting
No microphone input
Run python python/mic_test.py --list-devices, confirm OS microphone permission, and select the correct input device.
The model never triggers
Confirm 16 kHz mono audio, verify the model paths, start with the default threshold, and test in a quiet room before tuning.
Too many repeated triggers
Enable the cooldown layer after basic recognition works. Do not enable every filter before confirming the microphone and model are correct.
Use several commands instead of one wake word
The same runtime accepts a multi-keyword model. A callback can map “start”, “stop”, “next”, or device-specific phrases to local application actions without running full speech recognition.