$ show Picovoice/porcupine
Porcupine is a cross-platform wake word (keyword spotting) engine by Picovoice. The repository is a comprehensive SDK that provides native bindings for 10+ platforms including Android, iOS, Web (WASM), Python, Node.js, Java, .NET, Flutter, React Native, and embedded microcontrollers (STM32). The core engine is a proprietary binary (libpv_porcupine), but the repository contains all wrapper code, demos, and test infrastructure. The API is consistent across all bindings: a Porcupine class with init/process/release, a high-level PorcupineManager that handles microphone capture, and a set of built-in keywords for immediate use. The codebase demonstrates strong engineering practices: uniform error hierarchies, platform abstraction for library loading, and extensive CI/CD pipelines. The demos are production-quality and serve as integration templates. The repository is actively maintained with frequent commits and a large community (4.9k stars). The primary limitation is that the core engine is proprietary and requires a Picovoice access key, making the SDK itself not fully open-source. However, the binding code, patterns, and test infrastructure are reusable for other voice AI engines.
The LLM identified 3 files worth highlighting for reuse:
A structured JSON file defining test cases for wake word detection across multiple languages and platforms. It specifies input audio files, expected keyword detections, and language-specific parameters. This pattern enables consistent, data-driven testing across all bindings and can be reused for any engine's test suite with minimal modification.
A self-contained module that manages the lifecycle of a Web Worker for the engine. It implements a message queue and promise-based communication pattern, handling initialization, audio processing, and release messages. The pattern is generic and could be extracted for any Web Worker-based engine binding, providing a clean separation between UI thread and worker.
A React custom hook that encapsulates the full lifecycle of the wake word engine: initialization with access key, start/stop of audio capture, and automatic cleanup on unmount. It returns reactive state (isLoaded, isListening, detection) and callbacks. This pattern is reusable for integrating any SDK with a similar async lifecycle (init, start, stop, release) into React applications.