I'm creating a program that recognizes my voice saying: Open * name of a program * and it opens the program. I have a script to decrypt the name of all installed programs, but I do not know how to get what I want by taking this information.
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as s:
r.adjust_for_ambient_noise(s)
while True:
audio = r.listen(s)
try:
speech = r.recognize_google(audio, language = 'en-US')
speech = str(speech)
speech = speech.lower()
print('Você disse: ' + speech)
if 'bash' in speech:
#Should open the GitBash
if 'mozilla' in speech:
#Should open the Mozilla
except:
pass
I hope the program opens the program to speak