Porcupine is a highly accurate and lightweight wake word (hotword / keyword) detection engine, developed by Picovoice. It enables real-time voice trigger detection in Python with support for multiple platforms and languages. The current version is 4.0.2, requiring Python >=3.9.
pip install pvporcupineVerified import paths — ran on the pinned version, not inferred.
Initialize Porcupine with a built-in keyword. Requires a Picovoice Access Key from console.picovoice.ai.
Use keyword_paths=["/path/to/keyword.ppn"] instead of a single string or path object.
Check the actual sample_rate and frame_length from the Porcupine instance after creation.
Pass arguments as library_path and model_path (singular).
Always use a try-finally block or a context manager if available.
Ensure audio frames are decoded to 16-bit signed integers. For example, using struct.unpack or pvrecorder.
Run 'pip install pvporcupine' in the active virtual environment.
Sign up at console.picovoice.ai and use the generated AccessKey string.
Install pyaudio ('pip install pyaudio') and ensure your OS is supported (x86_64, arm64, etc.).Upgrade to the latest version: 'pip install --upgrade pvporcupine'.