Skip to content

Instantly share code, notes, and snippets.

@KaushikShresth07
Created June 17, 2021 11:46
Show Gist options
  • Select an option

  • Save KaushikShresth07/cd52546f6525e668d0b7ab953f7ced19 to your computer and use it in GitHub Desktop.

Select an option

Save KaushikShresth07/cd52546f6525e668d0b7ab953f7ced19 to your computer and use it in GitHub Desktop.
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