A Python-based desktop voice assistant that accepts spoken commands and performs basic tasks through voice interaction. The assistant uses speech recognition to interpret user commands and responds with synthesized speech, demonstrating the fundamentals of voice-controlled desktop automation.
- 🎤 Voice command recognition
- 🗣️ Spoken responses
- 🕒 Tell the current time
- 📅 Tell today's date
- 🌐 Open Google
▶️ Open YouTube- 📖 Search Wikipedia and read a short summary aloud
- 👋 Exit using voice commands
⚠️ Graceful handling of unrecognized speech and network errors
| Voice Command | Action |
|---|---|
| Hello | Greets the user |
| What is the time? | Speaks the current time |
| What is today's date? | Speaks today's date |
| Open Google | Opens Google in the default browser |
| Open YouTube | Opens YouTube |
| Search Albert Einstein | Reads a short Wikipedia summary |
| Exit / Stop | Closes the assistant |
- Python
- SpeechRecognition
- Google Speech Recognition API
- Wikipedia
- macOS
saycommand (Text-to-Speech) - webbrowser
- datetime
Voice-Assistant/
│
├── assistant.py
├── README.md
└── requirements.txt
Clone the repository:
git clone https://github.com/shriyatallapragada/OIBSIP-Python-Programming.gitNavigate to the project folder:
cd OIBSIP-Python-Programming/Voice-AssistantInstall the required dependencies:
pip install SpeechRecognition
pip install PyAudio
pip install wikipedia
pip install pyttsx3Run the assistant using:
python assistant.pyThe assistant will greet you and begin listening for voice commands through your system microphone.
- The assistant listens through the system microphone.
- Speech is converted to text using Google's Speech Recognition API.
- The recognised command is matched against predefined actions.
- The corresponding task is executed.
- The assistant responds using text-to-speech.
User Speaks
│
▼
Speech Recognition
│
▼
Command Processing
│
├── Open Websites
├── Search Wikipedia
├── Tell Time
├── Tell Date
└── Exit
│
▼
Voice Response
The current implementation uses the built-in macOS say command for speech synthesis.
| Platform | Support |
|---|---|
| macOS | ✅ Fully Supported |
| Windows | speak() function with a Windows-compatible text-to-speech library |
| Linux | speak() function with a Linux-compatible text-to-speech library |
- Cross-platform text-to-speech support
- Integration with Large Language Models (LLMs)
- Wake-word detection ("Hey Assistant")
- Calendar and reminder management
- Weather updates
- Email automation
- Music playback controls
- GUI interface
- Conversation history and memory
- Support for custom voice commands
This project helped strengthen my understanding of:
- Speech recognition in Python
- Voice-based user interaction
- Desktop automation
- API integration
- Exception handling
- Control flow and command processing
- Working with external Python libraries
Add a screenshot or GIF of the assistant in action here.
<p align="center">
<img src="assets/demo.gif" width="700">
</p>Developed for educational purposes as part of my Python programming portfolio.