Skip to content

Commit 65f8140

Browse files
authored
Update mysoft.py
1 parent e662793 commit 65f8140

File tree

1 file changed

+61
-15
lines changed

1 file changed

+61
-15
lines changed

mysoft.py

Lines changed: 61 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,90 @@
11
import pyttsx3
22
import os
3+
import speech_recognition as SRG
4+
import time
5+
import webbrowser
6+
engine=pyttsx3.init()
7+
8+
print('''
9+
10+
11+
----------------------------------------------------------------------------------------------------------------------
12+
----------------------------------------------------------------------------------------------------------------------
13+
14+
******* ******** ** ** ******
15+
******** ** ** ** ********
16+
** ** ** ** ** ** **
17+
** ** ** **** ** **
18+
******* ** **** ********
19+
** ** ** ** ** **
20+
** ** ** ** ** **
21+
** ******** ** ** ** **
22+
23+
----------------------------------------------------------------------------------------------------------------------
24+
----------------------------------------------------------------------------------------------------------------------
25+
26+
27+
''')
28+
pyttsx3.speak("hi there you can talk with me")
29+
print("hi there you can talk with me")
30+
pyttsx3.speak('what do you want me to do?')
331

4-
pyttsx3.speak("hi there you can chat with me as per your requirements")
5-
print()
632

733
while True:
8-
pyttsx3.speak('what do you want me to do?')
9-
print("chat with me as per your requirements: ",end='')
10-
p=input()
11-
if (("run" in p) or ("launch" in p) or ("execute"in p) or ("open" in p)) and ("notepad"in p):
34+
variable = SRG.Recognizer()
35+
with SRG.Microphone() as source:
36+
print('what do you want me to do?')
37+
engine.runAndWait()
38+
39+
audio_input = variable.record(source,duration=6)
40+
try:
41+
text = variable.recognize_google(audio_input)
42+
print(text)
43+
except:
44+
print(' Could not process audio...')
45+
pyttsx3.speak('Sorry Could not process audio')
46+
break
47+
if ('introduce' in text) or ('yourself' in text) :
48+
print('menu')
49+
pyttsx3.speak("myself pika your voice assistant developed by priyanka just just tell me what do you want me to do mam")
50+
51+
elif (("run" in text) or ("launch" in text) or ("execute"in text) or ("open" in text)) and (("notepad"in text)or("Notepad"in text)):
1252
pyttsx3.speak("opening notepad")
1353
os.system("notepad")
1454

15-
elif(("run" in p)or("launch" in p)or("execute"in p)or("open" in p)) and ("wmplayer"in p):
55+
elif(("run" in text)or("launch" in text)or("execute"in text)or("open" in text)) and (("media player"in text)or("media"in text)or("Music"in text)):
1656
pyttsx3.speak("opening wmplayer")
1757
os.system("wmplayer")
1858

19-
elif(("run" in p)or("launch" in p)or("execute"in p)or("open" in p)) and ("chrome"in p):
59+
elif(("run" in text)or("launch" in text)or("execute"in text)or("open" in text)) and (("chrome"in text)or("Chrome"in text)):
2060
pyttsx3.speak("opening chrome")
2161
os.system("chrome")
2262

23-
elif(("run" in p)or("launch" in p)or("execute"in p)or("open" in p)) and ("BurpSuite"in p):
63+
elif(("run" in text)or("launch" in text)or("execute"in text)or("open" in text)) and (("BurpSuite"in text)or("Burp"in text)):
2464
pyttsx3.speak("opening burpsuit")
2565
os.system("BurpSuiteCommunity")
2666

27-
elif(("run" in p)or("launch" in p)or("execute"in p)or("open" in p)) and ("calculator" in p):
28-
pyttsx3.speak("opening calculator")
67+
elif(("run" in text)or("launch" in text)or("execute"in text)or("open" in text)) and (("claculator"in text)or("cal"in text)):
68+
pyttsx3.speak("opening claculator")
2969
os.system("calc")
3070

31-
elif(("run" in p)or("launch" in p)or("execute"in p)or("open" in p)) and ("prompt"in p):
71+
elif(("run" in text)or("launch" in text)or("execute"in text)or("open" in text)) and (("prompt"in text)or("command"in text)):
3272
pyttsx3.speak("opening command prompt")
3373
os.system("cmd")
3474

35-
elif(("run" in p)or("launch" in p)or("execute"in p)or("open" in p)) and ("BurpSuite"in p):
75+
elif(("run" in text)or("launch" in text)or("execute"in text)or("open" in text)) and ("BurpSuite"in text):
3676
pyttsx3.speak("opening burpsuit")
3777
os.system("BurpSuiteCommunity")
3878

39-
elif("exit"in p)or("quit"in p):
79+
elif(("google" in text) or ("search" in text))and(("myself"in text)or("my name"in text)or("name")):
80+
pyttsx3.speak("googling stuffs")
81+
webbrowser.open('https://priyankaprasad2.bookmark.com/', new = 2)
82+
83+
elif("exit"in text)or("quit"in text):
4084
pyttsx3.speak("thank you i am sure developer will add more features later to me")
4185
break
86+
4287
else:
4388
print("invalid request")
44-
print()
89+
pyttsx3.speak("command not supported ")
90+
print()

0 commit comments

Comments
 (0)