Skip to content

iamFantom/Personal-Voice-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Jarvis — AI-Powered Personal Voice Assistant

A Python-based voice assistant inspired by Iron Man's Jarvis. It listens for a wake word, processes your voice commands, and can play music, read the latest news, open websites, and answer any question using Google's Gemini AI.


✨ Features

  • 🎙️ Wake Word Detection — Always listening for "Jarvis" to activate
  • 🌐 Website Launcher — Opens Google, YouTube, Facebook, Instagram on command
  • 🎵 Music Playback — Plays songs from your personal music library via the browser
  • 📰 News Reader — Reads out top headlines (Global, Pakistan, or BBC) using NewsAPI
  • 🤖 AI Responses — Answers any general query using Google Gemini 2.5 Flash
  • 🔊 Text-to-Speech — Speaks responses using Google TTS (gTTS) + Pygame audio playback
  • 💤 Sleep Command — Say "sleep now" to shut down Jarvis gracefully

🛠️ Tech Stack

Component Library/Service
Speech Recognition SpeechRecognition + Google Speech API
Text-to-Speech gTTS (Google Text-to-Speech)
Audio Playback pygame
AI Engine Google Gemini 2.5 Flash via google-genai
News NewsAPI
Fallback TTS pyttsx3

📁 Project Structure

jarvis/
│
├── main.py              # Main assistant logic
├── musicLibrary.py      # Dictionary of song names mapped to URLs
├── requirements.txt     # Python dependencies
└── README.md

⚙️ Setup & Installation

1. Clone the Repository

git clone https://github.com/your-username/jarvis-voice-assistant.git
cd jarvis-voice-assistant

2. Install Dependencies

pip install -r requirements.txt

3. Add Your API Keys

Open main.py and replace the placeholders with your actual keys:

newsapi = "YOUR_NEWSAPI_KEY"
gemini_key = "YOUR_GEMINI_API_KEY"

4. Set Up Your Music Library

Edit musicLibrary.py to add your songs:

music = {
    "believer": "https://www.youtube.com/watch?v=...",
    "shape of you": "https://www.youtube.com/watch?v=...",
}

5. Run Jarvis

python main.py

🎤 Voice Commands

Command Action
"Jarvis" Wake up the assistant
"Open Google" Opens google.com
"Open YouTube" Opens youtube.com
"Open Facebook" Opens facebook.com
"Open Instagram" Opens instagram.com
"Play [song name]" Plays the song from your music library
"News" Reads BBC top headlines
"Pakistan news" Reads top headlines from Pakistan
"Global news" Reads latest global news
"Sleep now" Shuts down Jarvis
Any other query Answered by Gemini AI

📦 Requirements

Create a requirements.txt with the following:

SpeechRecognition
pyttsx3
gTTS
pygame
requests
google-genai
pyaudio

Note: pyaudio may require additional setup on Windows. Install it via:

pip install pipwin
pipwin install pyaudio

🚀 Future Improvements

  • Add more website shortcuts
  • Expand the music library
  • Add smart home device control
  • Integrate calendar/reminder functionality
  • Build a GUI interface

📄 License

This project is open source and available under the MIT License.


Built with 🤍 using Python, Google Gemini, and gTTS.

About

A Python-based personal voice assistant powered by Google Gemini 2.5 Flash. Responds to a wake word, plays music, reads live news, opens websites, and answers any question using AI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages