Skip to content

Instantly share code, notes, and snippets.

@KaushikShresth07
Created May 25, 2021 05:58
Show Gist options
  • Save KaushikShresth07/b42f844eee5b258bbb9762b6ebeb2eed to your computer and use it in GitHub Desktop.
Save KaushikShresth07/b42f844eee5b258bbb9762b6ebeb2eed to your computer and use it in GitHub Desktop.
import os
import speech_recognition as sr
def takecommand():
command = sr.Recognizer()
with sr.Microphone() as source:
print("Listening......")
command.pause_threshold = 1
audio = command.listen(source)
try:
print("Recognizing.....")
query = command.recognize_google(audio,language='en-in')
print(f"You Said : {query}")
except:
return "none"
return query.lower()
while True:
wake_Up = takecommand()
if 'wake up' in wake_Up:
os.startfile('E:\\YT - Channel\\YT - Channel\\YouTube Wala Jarvis\\jarvis.py')
else:
print("Nothing......")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment