- OAuth authentication via Authentik - WebSocket connection to OpenClaw gateway - Configurable gateway URL with first-run setup - User preferences sync across devices - Multi-user support with custom assistant names - ElevenLabs TTS integration (local + remote) - FCM push notifications for alarms - Voice input via Google Speech API - No hardcoded secrets or internal IPs in tracked files
2.6 KiB
2.6 KiB
Wake Word Implementation Plan
Overview
Add "Hey Alfred" or "Alfred" wake word detection to activate voice input hands-free.
Technology Choice: Porcupine by Picovoice
Why Porcupine:
- ✅ On-device processing (no internet required)
- ✅ Low battery usage
- ✅ Free tier available (1 wake word, non-commercial)
- ✅ Android SDK available
- ✅ Custom wake words supported
Free Tier Limits:
- 1 user account
- 1 custom wake word model
- Non-commercial use only
- On-device processing (unlimited uses)
Implementation Steps
1. Sign up for Porcupine
- Go to https://console.picovoice.ai/
- Create account
- Get Access Key (free tier)
- Train custom "Alfred" wake word
2. Add Porcupine SDK
Add to app/build.gradle.kts:
dependencies {
implementation("ai.picovoice:porcupine-android:3.0.2")
}
3. Add to secrets.properties
PORCUPINE_ACCESS_KEY=<your-access-key-here>
4. Create WakeWordManager.kt
Similar to VoiceInputManager, this would:
- Initialize Porcupine with the wake word model
- Listen continuously in the background (low power mode)
- Trigger voice input when wake word detected
- Show visual feedback (e.g., pulse animation)
5. Add Background Service
Wake word detection needs to run in the background:
- Foreground service with notification
- Shows "Listening for 'Hey Alfred'..." notification
- Can be toggled on/off from app
- Respects battery optimization settings
6. UI Updates
Add toggle in settings or status bar:
- "Wake Word Detection" switch
- Shows when listening
- Visual feedback when triggered (e.g., microphone icon pulses)
User Experience Flow
- User enables "Wake Word Detection" in app
- App starts background service
- Notification shows: "Listening for 'Hey Alfred'"
- User says "Hey Alfred" or "Alfred"
- App shows visual feedback (screen lights up, icon pulses)
- Voice input starts automatically
- User speaks their message
- Message auto-sends when done
- Alfred responds with voice
Considerations
Battery Impact:
- Porcupine is optimized for low power
- Typically <1% battery drain per hour
- Can be toggled off when not needed
Privacy:
- All processing on-device
- No audio sent to cloud
- Only activates when wake word detected
Implementation Complexity:
- Medium complexity (1-2 hours work)
- Requires Porcupine setup
- Need background service implementation
- Permission handling (microphone always-on)
Next Steps
If you want this feature:
- Create Picovoice account
- Get Access Key
- Train "Alfred" wake word model
- I can implement the code integration
Let me know if you want to proceed with this! 🎤