Jarvis
Jarvis
import speech_recognition as sr
import datetime
import wikipedia
import webbrowser
import os
import urllib
import requests
import sys
import smtplib
print("Initialising Siri....")
MASTER = "Yashoditya"
AI = "Siri"
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
def speak(text):
engine.say(text)
engine.runAndWait()
def wishMe():
hour = int(datetime.datetime.now().hour)
else:
print(hour)
def takeCommand():
r = sr.Recognizer()
print("Listening...")
audio = r.listen(source)
try :
print("Recognising...")
query = None
return query
wishMe()
query = takeCommand()
if 'wikipedia' in query:
speak('Searching Wikipedia...')
print(results)
speak(results)
location = query
query = query.replace("find location of", "")
webbrowser.get().open(url)
webbrowser.get().open(url)
webbrowser.get(chrome_path).open(url)
url = "google.com"
webbrowser.get(chrome_path).open(url)
speak("Searching youtube")
webbrowser.get().open(url)
speak("opening google")
webbrowser.get().open(url)
# webbrowser.open("youtube.com")
url = "hotstar.com"
webbrowser.get(chrome_path).open(url)
# webbrowser.open("youtube.com")
url = "primevideo.com"
webbrowser.get(chrome_path).open(url)
songs_dir = "C:\\Users\\Administrator\\Desktop"
songs = os.listdir(songs_dir)
print(songs)
os.startfile(os.path.join(songs_dir, songs[0]))
strTime = datetime.datetime.now().strftime("%H:%M:%S")
while (1):
query = takeCommand()
respond(query)