🎤 AI-Powered Voice Command Emergency System Shutdown for Windows 11
VoiceGuard is a robust Windows 11 background service that provides immediate system shutdown capability through AI-powered voice command recognition. Designed for emergency situations, accessibility needs, and critical system protection scenarios.
- 24/7 Background Operation: Windows Service with automatic startup and recovery
- AI-Powered Recognition: OpenRouter.ai integration with smart 30-key rotation system
- Multi-Source Processing: OpenRouter.ai + Windows Speech API + keyword matching fallback
- Immediate Shutdown: Emergency system shutdown equivalent to power loss
- Dual-Process Architecture: Secure Session 0 service + user-session audio helper
- Configurable Commands: Support for custom "magic words" and phrases
- Adjustable Sensitivity: Microphone sensitivity levels (low/medium/high)
- Confidence Thresholds: Customizable recognition accuracy settings
- Multi-Word Support: Both single words and complex phrases as triggers
- Test Mode: Safe command testing without actual shutdown execution
- Confirmation Delays: 2-3 second countdown with audio confirmation
- Emergency Disable: Multiple abort mechanisms (Ctrl+Alt+Shift+ESC)
- Watchdog System: Multi-layer monitoring with automatic restart
- False Positive Protection: Requires consecutive detections within 5 seconds
- Configuration GUI: Complete PyQt6 interface for all settings
- System Tray Integration: Real-time status monitoring and quick controls
- Usage Analytics: API key rotation optimization and cost tracking
- Comprehensive Logging: Structured logging with filtering and export
- Automated Compatibility Checking: Prevents deprecated package warnings and compatibility issues
- Pre-Installation Validation: Comprehensive dependency checking before installation
- Version Compatibility Matrix: Validates Python/Windows versions and package combinations
- Emergency Fallback Mode: Graceful degradation when dependency issues occur
- Warning Suppression: Prevents deprecation warnings from terminating the service
- Automatic Updates: Smart dependency updates with backup and rollback capability
- Windows 11 (22H2 or later)
- Architecture: x64 only
- Privileges: Administrator rights for installation
- Python: 3.11 or higher
- .NET Runtime: 8.0 or later
- Visual C++ Redistributable: 2022 or later
- RAM: Minimum 4GB, Recommended 8GB
- Storage: 500MB free space
- Microphone: Any Windows-compatible microphone
- Network: Internet connection for AI processing (optional for offline mode)
- OpenRouter.ai Account: For enhanced AI recognition (optional)
- API Keys: Up to 30 keys for optimal performance (1,500 daily requests)
- Download the latest release from the Releases page
- Run as Administrator: Right-click
VoiceGuard-Setup.exe→ "Run as administrator" - Follow the installer: Complete the guided setup process
- Configure microphone permissions: Allow microphone access in Windows Settings
- Launch configuration: Run "VoiceGuard Configuration" from Start Menu
# Clone the repository
git clone https://github.com/yourusername/voiceguard.git
cd voiceguard
# Install Python dependencies
pip install -r requirements.txt
# Run installation script as Administrator
python install.py-
Microphone Permissions:
- Open Windows Settings → Privacy & Security → Microphone
- Enable "Microphone access" and "Let desktop apps access your microphone"
-
Service Verification:
- Open Services (services.msc)
- Verify "VoiceGuard Emergency Shutdown Service" is running
-
Initial Configuration:
- Launch VoiceGuard Configuration
- Complete the setup wizard
- Test voice commands in Test Mode
-
Open Configuration GUI:
Start Menu → VoiceGuard → VoiceGuard Configuration -
Add Voice Commands:
- Navigate to "Voice Commands" tab
- Click "➕ Add Command"
- Enter your emergency phrase (e.g., "emergency shutdown")
- Set confidence threshold (recommended: 60-80%)
- Enable the command
-
Default Commands:
- "emergency shutdown"
- "kill switch"
- "force stop"
- "shutdown now"
-
Microphone Setup:
- Select your microphone device
- Adjust sensitivity slider (recommended: 70-90%)
- Test audio levels with real-time meter
-
Recognition Settings:
- Set confidence threshold (60% recommended)
- Enable noise suppression
- Configure voice activity detection
-
Create OpenRouter.ai Account:
- Visit OpenRouter.ai
- Sign up and verify your account
- Generate API keys (up to 30 for optimal performance)
-
Add API Keys:
- Open VoiceGuard Configuration
- Navigate to "AI Configuration" tab
- Click "📥 Import Keys"
- Add your API keys (one per line)
- Verify key functionality with "🧪 Test Keys"
-
Key Rotation Strategy:
- Smart Load Balancing (recommended): Distributes load evenly
- Round Robin: Sequential key usage
- Least Used First: Prioritizes unused keys
- Random Selection: Random key selection
-
Confirmation Delay:
- Set delay between command detection and shutdown (3 seconds recommended)
- Allows time for cancellation if needed
-
Emergency Disable:
- Enable Ctrl+Alt+Shift+ESC emergency abort
- Configure quiet hours to prevent accidental activation
-
Test Mode:
- Always test new commands in Test Mode first
- Commands are logged but no shutdown occurs
- Auto-expires after 30 minutes for safety
-
Service Status: Check system tray icon for service status
- 🟢 Green: Active and monitoring
- 🟡 Yellow: Warning or limited functionality
- 🔴 Red: Service not running
- 🔵 Blue: Test mode active
-
Voice Commands: Speak your configured emergency phrase clearly
- System will detect and process the command
- 3-second confirmation countdown begins
- System shuts down immediately after countdown
-
Cancellation: To abort a pending shutdown:
- Press Ctrl+Alt+Shift+ESC immediately
- Or use the system tray "Cancel Shutdown" option
-
Enable Test Mode:
- Right-click system tray icon → "Toggle Test Mode"
- Or use Configuration GUI → "🧪 Test Mode" button
-
Testing Commands:
- Speak your voice commands normally
- Commands are detected and logged
- No actual shutdown occurs
- Check logs for recognition accuracy
-
Disable Test Mode:
- Test mode auto-expires after 30 minutes
- Or manually disable via system tray/GUI
VoiceGuard includes a comprehensive dependency management system to prevent compatibility issues:
-
Check Dependency Status:
python src/dependency_cli.py check
-
Update Dependencies:
python src/dependency_cli.py update
-
Validate Component Dependencies:
python src/dependency_cli.py validate service # Service dependencies python src/dependency_cli.py validate gui # GUI dependencies python src/dependency_cli.py validate audio # Audio dependencies
-
Backup and Restore:
python src/dependency_cli.py backup # Create backup python src/dependency_cli.py restore /path/to/backup # Restore from backup
-
Cleanup Old Data:
python src/dependency_cli.py cleanup --days 30
The dependency system automatically:
- Validates package compatibility before installation
- Prevents deprecated package warnings from stopping the service
- Creates backups before making changes
- Provides emergency fallback mode for critical operations
- Test thoroughly before relying on VoiceGuard in emergencies
- Have backup shutdown methods available (physical power button, etc.)
- Inform others in your environment about the voice command system
- Regular testing ensures continued functionality
- Keep API keys active for optimal recognition accuracy
# Check service status
sc query VoiceGuardService
# Restart service
sc stop VoiceGuardService
sc start VoiceGuardService
# Check logs
type "C:\ProgramData\VoiceGuard\logs\service.log"- Check microphone permissions in Windows Settings
- Verify microphone device in Configuration GUI
- Adjust sensitivity settings (try 80-90%)
- Test in quiet environment to eliminate background noise
- Check API key status in AI Configuration tab
- Reduce audio buffer size in Advanced settings
- Lower microphone sensitivity to reduce processing
- Disable unnecessary features (noise suppression, etc.)
- Check for conflicting audio software
- Verify key validity with Test Keys function
- Check daily usage limits (50 requests per key)
- Ensure keys are active in OpenRouter.ai dashboard
- Add more keys if hitting rate limits
Log Locations:
- Service logs:
C:\ProgramData\VoiceGuard\logs\service.log - Helper logs:
C:\ProgramData\VoiceGuard\logs\helper.log - GUI logs:
C:\ProgramData\VoiceGuard\logs\config_gui.log
Important Log Events:
- Event ID 1001: Service started
- Event ID 2002: System shutdown initiated
- Event ID 3001: High CPU usage detected
- Check Documentation: Review this README and inline help
- View Logs: Use Configuration GUI → Logs tab for detailed information
- GitHub Issues: Report bugs at Issues
- Community Support: Join discussions in Discussions
┌─────────────────────────────────────────────────────────────┐
│ VoiceGuard System │
├─────────────────────────────────────────────────────────────┤
│ Session 0 (Service Layer) User Session (Audio) │
│ ┌─────────────────────────┐ ┌─────────────────────┐ │
│ │ VoiceGuard Service │◄─────►│ Audio Helper │ │
│ │ - System Shutdown │ IPC │ - Microphone │ │
│ │ - Watchdog Logic │ │ - Speech Processing│ │
│ │ - Configuration │ │ - AI Integration │ │
│ │ - Event Logging │ │ - System Tray │ │
│ └─────────────────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
- VoiceGuard Service: Core Windows Service handling shutdown logic
- Audio Helper: User-session process for microphone access and AI processing
- Configuration GUI: PyQt6 application for system configuration
- Watchdog System: Multi-layer monitoring and recovery system
- IPC Communication: Secure Named Pipes for inter-process communication
- Least Privilege: Service runs with minimal required permissions
- Session Isolation: Audio processing isolated from critical shutdown logic
- Encrypted Storage: API keys and sensitive data encrypted with DPAPI
- Access Control: Named pipes protected with Windows ACLs
We welcome contributions to VoiceGuard! Please see our Contributing Guidelines for details.
# Clone repository
git clone https://github.com/yourusername/voiceguard.git
cd voiceguard
# Create virtual environment
python -m venv venv
venv\Scripts\activate
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
python -m pytest tests/- Python: Follow PEP 8 with Black formatting
- Documentation: Comprehensive docstrings for all functions
- Testing: Unit tests required for new features
- Security: Security review required for all changes
This project is licensed under the MIT License - see the LICENSE file for details.
VoiceGuard is designed for emergency and accessibility use cases. Users are responsible for:
- Testing thoroughly before relying on the system
- Understanding the risks of automated system shutdown
- Complying with local regulations regarding emergency systems
- Maintaining backup shutdown methods
The developers are not liable for any damages resulting from the use or misuse of this software.
- OpenRouter.ai for providing AI speech recognition services
- Microsoft for Windows Speech Recognition APIs
- PyQt6 for the configuration GUI framework
- Contributors who help improve VoiceGuard
Made with ❤️ for emergency preparedness and accessibility