openWakeWord
raw JSON → 0.6.0 verified Fri May 01 auth: no python
An open-source audio wake word (or phrase) detection framework with a focus on performance and simplicity. Current version is 0.6.0. Releases are periodic with enhancements and bug fixes.
pip install openwakeword Common errors
error ModuleNotFoundError: No module named 'openwakeword' ↓
cause openwakeword is not installed.
fix
Run
pip install openwakeword. error ValueError: Audio frames must be a list of numpy arrays ↓
cause Input to predict() is not a list of numpy arrays.
fix
Wrap your audio chunk in a list:
predict([audio_array]). error FileNotFoundError: [Errno 2] No such file or directory: '.../models/alexa.onnx' ↓
cause Model files are missing (not downloaded). Since v0.6.0, models are no longer bundled.
fix
Run
from openwakeword.utils import download_models; download_models() or use the CLI command. Warnings
breaking In v0.6.0, model files were removed from the package. You must download them separately using `openwakeword.utils.download_models()` or use the CLI. ↓
fix Run `openwakeword.utils.download_models()` or `python -m openwakeword.utils.download_models` before inference.
gotcha The default inference framework on Linux is tflite since v0.5.0. This may not be installed by default; ensure you have the necessary dependencies. ↓
fix Install tensorflow or onnxruntime as needed, and specify framework='onnx' if you prefer ONNX.
gotcha Input audio must be a list of 1D numpy arrays (dtype=float32) normalized to [-1, 1]. Passing raw integer PCM data will produce incorrect results. ↓
fix Convert audio to float32 and normalize before passing to predict.
Imports
- OpenWakeWord wrong
import openwakewordcorrectfrom openwakeword import OpenWakeWord - Model
from openwakeword.model import Model
Quickstart
from openwakeword import OpenWakeWord
oww = OpenWakeWord()
audios = [] # list of audio chunks (numpy arrays)
predictions = oww.predict(audios)