# Wake-Word Detection Service Wake-word detection service using openWakeWord for detecting "Hey Atlas". ## Features - Real-time wake-word detection using openWakeWord - WebSocket events for detection notifications - HTTP API for control (start/stop) - Low-latency audio processing - Configurable threshold ## Installation ```bash # Install system dependencies (Ubuntu/Debian) sudo apt-get install portaudio19-dev python3-pyaudio # Install Python dependencies pip install -r requirements.txt ``` ## Usage ### Standalone Service ```bash # Run as HTTP/WebSocket server python3 -m wake-word.server # Or use uvicorn directly uvicorn wake-word.server:app --host 0.0.0.0 --port 8002 ``` ### Python API ```python from wake_word.detector import WakeWordDetector def on_detection(): print("Wake-word detected!") detector = WakeWordDetector( wake_word="hey atlas", threshold=0.5, on_detection=on_detection ) detector.start() # ... do other work ... detector.stop() ``` ## API Endpoints ### HTTP - `GET /health` - Health check - `GET /status` - Get detection status - `POST /start` - Start wake-word detection - `POST /stop` - Stop wake-word detection ### WebSocket - `WS /events` - Receive wake-word detection events **WebSocket Message Format:** ```json { "type": "wake_word_detected", "wake_word": "hey atlas", "timestamp": 1234.56 } ``` ## Configuration - **Wake-word**: "hey atlas" (default) - **Sample Rate**: 16000 Hz - **Threshold**: 0.5 (confidence threshold) - **Chunk Size**: 1280 samples ## Integration The wake-word service emits events that trigger: 1. ASR service to start capturing audio 2. LLM processing pipeline 3. TTS response ## Testing ```bash # Test detector directly python3 -m wake-word.detector # Test HTTP server curl http://localhost:8002/health curl -X POST http://localhost:8002/start curl -X POST http://localhost:8002/stop ``` ## Notes - Requires microphone access - Uses openWakeWord (Apache 2.0 license) - For custom wake-words, need to train a model - Default model may need fine-tuning for "Hey Atlas"