Jarvis is a voice-activated virtual assistant written in Python. It listens for a wake word ("Jarvis") and performs various tasks such as opening websites, playing songs, answering general queries using Google's Gemini AI, and more.
- 🎙️ Wake word recognition (
"Jarvis") - 🗣️ Text-to-speech interaction using
pyttsx3 - 🌐 Open popular websites (Google, YouTube, WhatsApp, etc.)
- 🎵 Play theme songs from a predefined music library
- 🧠 Answer queries using Google Gemini
- 📁 Open local image file
- 📅 Announces current date and time
- 📰 (Optional) News headlines feature (currently commented out)
- 💬 Gracefully exits on
"stop","quit", or"exit conversation"
- Python 3
speech_recognition– For converting speech to textpyttsx3– For text-to-speech functionalitywebbrowser– To open URLs in the default browseros– For local file handlingrequests– For API calls (optional news feature)google.generativeai– For processing AI responses using Google Gemini
- Jarvis listens for the wake word
"Jarvis". - Once triggered, it asks for your command.
- Based on the command:
- It can open websites like Google, YouTube, WhatsApp, Facebook, etc.
- It can play specific theme songs (
got,friends,pubg, etc.). - It can answer questions using Gemini AI.
- It can open an image file.
- It exits the chat when asked to stop.
You can trigger these using play <songname>:
| Song Name | Description |
|---|---|
| got | Game of Thrones Theme |
| friends | Friends Theme |
| tahm | Two and a Half Men Theme |
| himym | How I Met Your Mother Theme |
| pubg | PUBG Background Score |
| waka | Waka Waka by Shakira |
"open google""open youtube""play got""what is a black hole?""stop conversation"/"exit conversation"/"quit conversation"
- Google Gemini API Key – Required for AI responses
- News API Key – Optional (currently commented out)
-
Install dependencies:
pip install pyttsx3 SpeechRecognition requests PyAudio
-
Set your API keys in the script:
gemini_api_key = "YOUR_GEMINI_API_KEY" ews_api_key = "YOUR_NEWS_API_KEY" # optional
-
Run the script:
python main.py
🙋♀️ Created by Jayshree A passionate techie, engineer, and voice interface enthusiast!
📌 Notes You must have an active internet connection for Gemini and news features to work.