A Python-based voice assistant inspired by Iron Man's JARVIS, designed specifically for macOS. This assistant uses speech recognition to listen for voice commands and responds with both voice feedback and actions.
- Voice Recognition: Uses Google Speech Recognition API to understand voice commands
- AI-Powered Responses: Integrates with Google's Gemini AI for intelligent responses to general questions
- Web Navigation: Quick commands to open popular websites (Google, YouTube, Facebook, Twitter, Instagram, Reddit, GitHub, LinkedIn)
- Music Control: Built-in music library with voice commands to play specific songs
- Voice Feedback: Uses macOS built-in
say
command for text-to-speech responses - Wake Word: Activates when you say "Jarvis"
- Audio Feedback: Provides beeping sounds during AI processing
- macOS (required for the
say
command and audio playback) - Python 3.x
- Microphone access
- Google Gemini API key
-
Clone the repository
git clone <repository-url> cd Jarvis-Voice-Assistant
-
Create virtual environment
python3 -m venv venv
-
Activate virtual environment
source venv/bin/activate
-
Install dependencies
pip3 install -r requirements.txt
-
Set up environment variables Create a
.env
file in the project root and add your Gemini API key:GEMINI_API_KEY=your_api_key_here
-
Start the program
python3 main.py
-
Activate the assistant
- Say "Jarvis" to wake up the assistant
- Wait for the "Yes?" response
- Give your command
- "Open Google"
- "Open YouTube"
- "Open Facebook"
- "Open Twitter"
- "Open Instagram"
- "Open Reddit"
- "Open GitHub"
- "Open LinkedIn"
- "Play pal pal"
- "Play qatal"
- "Play diamond"
- "Play millionaire"
- "Play unforgettable"
- "Play heer"
- "Play haseen"
- "Play maand"
- Ask any general question and Jarvis will use Gemini AI to provide an intelligent response
- The program continuously listens for the wake word "Jarvis"
- When detected, it responds with "Yes?" and starts listening for your command
- Commands are processed through:
- Built-in web navigation functions
- Music library lookup
- Gemini AI for general questions
- Responses are provided via voice using macOS text-to-speech
- During AI processing, a beeping sound indicates the system is working
main.py
- Main application with voice recognition and command processingmusicLibrary.py
- Dictionary of song names and their YouTube URLsrequirements.txt
- Python dependencies.env
- Environment variables (create this file with your API key)
Key dependencies include:
google-generativeai
- For AI-powered responsesspeech_recognition
- For voice command recognitionPyAudio
- For audio input/outputpython-dotenv
- For environment variable management
- This assistant is specifically designed for macOS due to its use of the
say
command andafplay
for audio - Requires an active internet connection for speech recognition and AI responses
- The music library can be expanded by adding more songs to
musicLibrary.py
- Ensure your microphone permissions are enabled
- Check that your Gemini API key is correctly set in the
.env
file - Make sure you're in a quiet environment for better voice recognition
- Verify that all dependencies are properly installed in the virtual environment