This is a Python-based virtual assistant named Jarvis, which can perform a variety of tasks such as opening websites, playing music, and processing commands via voice recognition. It uses several libraries, including speech_recognition
, pyttsx3
, pygame
, and OpenAI
API, to function like a personal assistant.
- Voice command recognition with
speech_recognition
. - Text-to-speech responses with
gTTS
andpygame
. - Integration with OpenAI's GPT-3.5 for processing commands.
- Ability to open popular websites like Google, Facebook, YouTube, etc.
- Can play music from a predefined music library.
Before running this program, make sure you have the following dependencies installed:
speech_recognition
pyttsx3
gTTS
pygame
openai
musicLibrary
(custom module or replace with your own music library)
You can install the necessary libraries using the following:
pip install SpeechRecognition pyttsx3 gTTS pygame openai
Music Library You'll need a custom musicLibrary.py file that stores the music links for different songs. Here's an example format for the musicLibrary.py:
python Copy code music = { "song_name": "song_url" }
- Clone the repository or download the project files.
- Set up the OpenAI API key in the code.
- Install the required libraries (listed above).
- Run the program:
python jarvis_assistant.py
- Run the program and it will initialize with a voice prompt saying "Initializing Jarvis....".
- Once the assistant is active, you can say "Jarvis" to wake it up.
- After saying "Jarvis", you can issue commands like: "Open Google" "Open YouTube" "Play [song_name]" Jarvis will then perform the requested task, such as opening a website or playing music.