I am experiencing a problem when i am creating AI assistant
When i am writing code-
It is showing unknown value error.
I am unable to understand what is the problem
It should take command but showing error, I am learning python by making basic Assistant that takes command and execute it.
import speech_recognition as sr
import os
def say(text):
os.system(f"say {text}")
def takecommand():
mic=sr.Recognizer()
with sr.Microphone() as source:
mic.pause_threshold = 1
audio=mic.listen(source)
query=mic.recognize_google(audio, language="eng-in")
print(f"User said {query}")
return query
if __name__== '__main__':
print("VS CODE")
say("Hii My Name is JARVIS A.I.")
print("Listening...")
text=takecommand()
say(text)
New contributor
Sam Gaming FF is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.