Skip to content

DaoudSabat/virtualAssistantPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Virtual Assistant (Jarvis)

Voice-activated desktop assistant that listens to spoken commands and responds with text-to-speech.

Overview

Jarvis captures microphone input, sends it through Google's Speech Recognition API, and dispatches the recognised command to the appropriate handler — web search, Wikipedia lookup, time/date query, or browser navigation. All responses are spoken back via pyttsx3 (offline TTS). The assistant runs in a continuous listen → respond loop until "exit" or "bye" is spoken.

Architecture

virtualAssistantPy/
├── core/
│   └── assistant.py      # VirtualAssistant — speech I/O and command dispatch
├── utils/                # Reserved for future helpers
├── tests/
│   └── test_assistant.py # pytest unit tests (mic and speaker mocked)
├── main.py               # Entry point
└── requirements.txt

Design Patterns

  • Commandrun() maps each recognised phrase to a dedicated action method (tell_day, tell_time, open_google, wikipedia_search), making it trivial to add new commands
  • FacadeVirtualAssistant encapsulates pyttsx3, SpeechRecognition, and wikipedia behind a single interface; callers see only run(), speak(), and listen()

Tech Stack

  • Python 3.10+
  • pyttsx3 — offline text-to-speech engine
  • SpeechRecognition — Google Speech API for voice input
  • wikipedia — article summary retrieval
  • webbrowser — cross-platform URL launching
  • pytest — unit testing

Installation

git clone https://github.com/DaoudSabat/virtualAssistantPy.git
cd virtualAssistantPy
pip install -r requirements.txt

On Windows, PyAudio may require: pipwin install pyaudio

Usage

python main.py

Say any of the following:

  • "Open Google" → prompts for a search term
  • "Which day is it?" → speaks today's day
  • "Tell me the time" → speaks the current time
  • "Python from Wikipedia" → reads a summary
  • "Exit" or "Bye" → stops the assistant

Tests

pytest tests/ -v

Tests mock the microphone, speaker, and browser — no hardware required.

License

MIT

About

A simple Python voice assistant that listens to your commands and performs actions like telling the time, searching Google/Wikipedia, opening websites, and responding with greetings using speech recognition and text-to-speech

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages