Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

🎙️ Voice Assistant

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.


✨ Features

  • 🎤 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

📝 Supported Commands

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

🛠️ Tech Stack

  • Python
  • SpeechRecognition
  • Google Speech Recognition API
  • Wikipedia
  • macOS say command (Text-to-Speech)
  • webbrowser
  • datetime

📂 Project Structure

Voice-Assistant/
│
├── assistant.py
├── README.md
└── requirements.txt

⚙️ Installation

Clone the repository:

git clone https://github.com/shriyatallapragada/OIBSIP-Python-Programming.git

Navigate to the project folder:

cd OIBSIP-Python-Programming/Voice-Assistant

Install the required dependencies:

pip install SpeechRecognition
pip install PyAudio
pip install wikipedia
pip install pyttsx3

▶️ Running the Project

Run the assistant using:

python assistant.py

The assistant will greet you and begin listening for voice commands through your system microphone.


⚙️ How It Works

  1. The assistant listens through the system microphone.
  2. Speech is converted to text using Google's Speech Recognition API.
  3. The recognised command is matched against predefined actions.
  4. The corresponding task is executed.
  5. The assistant responds using text-to-speech.

📊 Workflow

User Speaks
      │
      ▼
Speech Recognition
      │
      ▼
Command Processing
      │
      ├── Open Websites
      ├── Search Wikipedia
      ├── Tell Time
      ├── Tell Date
      └── Exit
      │
      ▼
Voice Response

💻 Platform Compatibility

The current implementation uses the built-in macOS say command for speech synthesis.

Platform Support
macOS ✅ Fully Supported
Windows ⚠️ Requires replacing the speak() function with a Windows-compatible text-to-speech library
Linux ⚠️ Requires replacing the speak() function with a Linux-compatible text-to-speech library

🚀 Future Improvements

  • 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

📚 Learning Outcomes

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

📸 Demo

Add a screenshot or GIF of the assistant in action here.

<p align="center">
  <img src="assets/demo.gif" width="700">
</p>

📄 License

Developed for educational purposes as part of my Python programming portfolio.