A Python-based voice command system that allows you to control your Windows computer using voice commands.
- Open Browser: Opens your default web browser
- Close Browser: Closes all running browser windows
- Lock Screen: Locks your Windows screen
- Shutdown Computer: Shuts down your computer (with confirmation)
- Restart Computer: Restarts your computer (with confirmation)
- Help System: Shows available commands
Option A: Automatic Setup
python setup.pyOption B: Manual Installation
pip install -r requirements.txtpython voice_controller.py| Command | Action |
|---|---|
| "open browser" | Opens default web browser |
| "close browser" | Closes all browser windows |
| "lock screen" | Locks Windows screen |
| "shutdown" | Shuts down computer (asks for confirmation) |
| "restart" | Restarts computer (asks for confirmation) |
| "help" | Shows available commands |
| "exit" or "quit" | Stops the voice controller |
- Python 3.7+
- Windows OS (for full functionality)
- Microphone (for voice input)
- Internet connection (for speech recognition)
speechrecognition- For voice recognitionpyaudio- For microphone accesspyttsx3- For text-to-speechpyautogui- For GUI automationpsutil- For process managementpygetwindow- For window management
1. PyAudio Installation Error on Windows:
# Download the appropriate wheel file from:
# https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
# Then install with:
pip install PyAudio-0.2.11-cp39-cp39-win_amd64.whl2. Microphone Not Working:
- Check Windows microphone permissions
- Ensure microphone is not muted
- Test microphone in other applications
3. Speech Recognition Errors:
- Check internet connection
- Speak clearly and loudly
- Reduce background noise
4. "Command not recognized":
- Speak slowly and clearly
- Use exact command phrases
- Say "help" to see available commands
- Shutdown/Restart commands require voice confirmation to prevent accidental execution
- The program only responds to recognized voice commands
- No remote access or network listening capabilities
- Speak clearly and at a moderate pace
- Wait for the "Listening..." prompt before speaking
- Use exact command phrases for best recognition
- Check console output for command confirmations
- Say "help" if you forget available commands
You can modify the voice commands by editing the process_command() method in voice_controller.py:
def process_command(self, command):
# Add your custom commands here
if "your custom command" in command:
# Your custom action
pass- OS: Windows 10/11 (recommended)
- RAM: 4GB minimum
- Storage: 100MB for dependencies
- Audio: Working microphone and speakers
- Network: Internet connection for speech recognition
- Recognition Speed: ~2-3 seconds per command
- CPU Usage: Low (< 5% during recognition)
- Memory Usage: ~50-100MB
- Accuracy: 90%+ in quiet environments
Feel free to:
- Add new voice commands
- Improve speech recognition accuracy
- Add support for other operating systems
- Report bugs or suggest features
This project is open source. Use responsibly and at your own risk.
If you encounter issues:
- Check the troubleshooting section above
- Ensure all dependencies are installed correctly
- Test your microphone with other applications
- Run the setup script again if needed
Enjoy controlling your computer with your voice! 🎙️# speech-recognition