Jarvis project by python
Hello everyone,
Today we are came up with the one new software Jarvis
As you saw in the Avengers movie, Tony Stark orders his virtual personal assistant and he works for him. Today, We are going to make similar software which is named Jarvis.
So without wasting any time, we move to our coding section now! And make your virtual assistant today 😁
Today, I make a Jarvis software with a some common instructions
You can also add many other instructions which you wanna in your daily life.
Jarvis project by python | A.I of Jarvis | Jarvis Software
import speech_recognition as sr
from time import ctime
import time
import os
from gtts import gTTS
def speak(audioString):
print(audioString)
tts = gTTS(text=audioString, lang='en')
tts.save("audio.mp3")
os.system("mpg321 audio.mp3")
def recordAudio():
# Record Audio
r = sr.Recognizer()
with sr.Microphone() as source:
print("Say something!")
audio = r.listen(source)
# Speech recognition using Google Speech Recognition
data = ""
try:
# Uses the default API key
# To use another API key: `r.recognize_google(audio, key="GOOGLE_SPEECH_RECOGNITION_API_KEY")`
data = r.recognize_google(audio)
print("You said: " + data)
except sr.UnknownValueError:
print("Google Speech Recognition could not understand audio")
except sr.RequestError as e:
print("Could not request results from Google Speech Recognition service; {0}".format(e))
return data
def jarvis(data):
if "how are you" in data:
speak("I am fine")
if "what time is it" in data:
speak(ctime())
if "where is" in data:
data = data.split(" ")
location = data[2]
speak("Hold on Frank, I will show you where " + location + " is.")
os.system("chromium-browser https://www.google.nl/maps/place/" + location + "/&")
# initialization
time.sleep(2)
speak("Hi Frank, what can I do for you?")
while 1:
data = recordAudio()
jarvis(data)
Now our Jarvis software is ready with the help of python programming.
You can also add many other option which you wanna in your daily life...
And now you can run this code in any python interpreter like, visual studio code any many more. And believe me this Jarvis software make your life easier.
Jarvis software.....
Jarvis project | Jarvis software | Jarvis project by python | codeswithabhi
Learn Python Programming Language
Learn C++ Programming Language