You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
speak("Soja Lau rae, teri baandi nahi hae, hahahaha")
28
+
29
+
30
+
elifhour>=4andhour<12:
31
+
speak("Uth gaya Lodu chand")
32
+
elifhour>=12andhour<17:
33
+
speak("Saalae abhi sonae ka time hae mera, matt jagaya kar mekko bc!")
34
+
elifhour>=17andhour<19:
35
+
speak("paar nae baith lodu")
36
+
elifhour>=19andhour<24:
37
+
speak("lau rae soja bc")
38
+
39
+
ifhour>=0andhour<=4:
40
+
pass
41
+
else:
42
+
speak("Hemlo domst, Mein hu Jarvis! Jarvis to chu tia hae ! mein hu badass jarvis! bol lau rae kya kar sakta hu tere liye, english mein bolna, developer chu tia hae, hindi voice nahi dala")
43
+
44
+
deftakeCommand(): #takes microphone inout and returns output
45
+
r=sr.Recognizer()
46
+
withsr.Microphone() assource:
47
+
print("Listening...")
48
+
r.pause_threshold=1
49
+
audio=r.listen(source)
50
+
51
+
try:
52
+
print("Recognizing...")
53
+
query=r.recognize_google(audio, language='en-in') #Using google for voice recognition
54
+
print(f"User said: {query}\n") #User query will be printed
55
+
exceptExceptionase:
56
+
print("Say that again please...") #Say that again will be printed in case of improper voice
list_of_jokes= ["The three most well known languages in India are English, Hindi, and... JavaScript","Interviewer... Where were you born?Me in India... Interviewer:.. oh, which part?... Me: What ‘which part’ ..? Whole body was born in India","how many Indians does it take to fix a lightbulb?Two. One to do the task and other to explain how lightbulbs were actually invented in ancient India","What do you call bread from India? It's Naan of your business","Britain: Drive on the left side... Europe and America: Drive on the right side...India: lol what's a 'traffic law'?"]
25
+
jokes=len(list_of_jokes)-1
26
+
ran_joke=random.randint(0,jokes)
27
+
28
+
29
+
30
+
defspeak(audio): #speak audio
31
+
engine.say(audio)
32
+
engine.runAndWait()
33
+
34
+
defwishMe(): #wishes me
35
+
hour=int(datetime.datetime.now().hour)
36
+
ifhour>=0andhour<=3:
37
+
speak("It's Late Night Sir!, You should sleep right now")
38
+
39
+
40
+
elifhour>=4andhour<12:
41
+
speak("Good Moring Master!")
42
+
elifhour>=12andhour<17:
43
+
speak("Good Afternoon Sir !")
44
+
elifhour>=17andhour<19:
45
+
speak("Good Evening !")
46
+
elifhour>=19andhour<24:
47
+
speak("Good Night Sir!")
48
+
49
+
ifhour>=0andhour<=4:
50
+
pass
51
+
else:
52
+
speak("I am Your Personal assistant, Jarvis! version 1.2! With the power of 8 gigabytes of ram, along with GPU and SSD")
53
+
54
+
deftakeCommand(): #takes microphone inout and returns output
55
+
r=sr.Recognizer()
56
+
withsr.Microphone() assource:
57
+
print("Listening...")
58
+
r.pause_threshold=1
59
+
audio=r.listen(source)
60
+
61
+
try:
62
+
print("Recognizing...")
63
+
query=r.recognize_google(audio, language='en-in') #Using google for voice recognition
64
+
print(f"User said: {query}\n") #User query will be printed
65
+
exceptExceptionase:
66
+
print("Say that again please...") #Say that again will be printed in case of improper voice
0 commit comments