Voice-activated desktop assistant that listens to spoken commands and responds with text-to-speech.
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.
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
- Command —
run()maps each recognised phrase to a dedicated action method (tell_day,tell_time,open_google,wikipedia_search), making it trivial to add new commands - Facade —
VirtualAssistantencapsulates pyttsx3, SpeechRecognition, and wikipedia behind a single interface; callers see onlyrun(),speak(), andlisten()
- 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
git clone https://github.com/DaoudSabat/virtualAssistantPy.git
cd virtualAssistantPy
pip install -r requirements.txtOn Windows, PyAudio may require:
pipwin install pyaudio
python main.pySay 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
pytest tests/ -vTests mock the microphone, speaker, and browser — no hardware required.
MIT