0
I made a program to open apps from a folder, and in this case it works perfectly, the problem is that it gives error if I say nothing, and my goal was to let the program running in the background
import speech_recognition as sr
import os
while True:
recognizer = sr.Recognizer()
mic = sr.Microphone()
with mic as source:
audio = recognizer.listen(source)
output = recognizer.recognize_google(audio)
print(output)
if 'break' in output:
break
elif 'open' in output:
app = output.replace('open ', '')
print(app)
os.startfile(f"C:\AtalhosFaim\{app}")
print('Nada')
print(output)
print('Fim')