Created
June 17, 2021 11:46
-
-
Save KaushikShresth07/cd52546f6525e668d0b7ab953f7ced19 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def Listen(): | |
| import speech_recognition as sr | |
| r = sr.Recognizer() | |
| with sr.Microphone() as source: | |
| print(" ") | |
| print("Listening...") | |
| r.pause_threshold = 1 | |
| audio = r.listen(source) | |
| try: | |
| print(" ") | |
| print("Recognizing...") | |
| query = r.recognize_google(audio, language='en-in') | |
| print(f"Your Command : {query}\n") | |
| except: | |
| return "None" | |
| return query.lower() | |
| def Say(Audio): | |
| import pyttsx3 | |
| Assistant = pyttsx3.init('sapi5') | |
| Voices = Assistant.getProperty('voices') | |
| Assistant.setProperty('voices',Voices[2].id) | |
| Assistant.setProperty('rate',170) | |
| print(f"Assistant : {Audio}") | |
| print(" ") | |
| Assistant.say(Audio) | |
| Assistant.runAndWait() | |
| print(" ") | |
| import os | |
| import webbrowser | |
| from time import sleep | |
| import keyboard | |
| def StartApp(Path): | |
| os.startfile(str(Path)) | |
| def CloseApp(Name): | |
| os.system(f"TASKKILL /F /im {Name}.exe") | |
| def StartWeb(Name): | |
| htt = f"https://www.{Name}.com" | |
| webbrowser.open(htt) | |
| def CloseWeb(): | |
| keyboard.press_and_release("ctrl + w") | |
| def SearchSystem(Name): | |
| keyboard.press_and_release("windows + s") | |
| sleep(2) | |
| keyboard.write(Name) | |
| sleep(1) | |
| keyboard.press('enter') | |
| def Summary(About): | |
| import wikipedia | |
| information = wikipedia.summary(About,2) | |
| return information | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment