I’m trying to built an assistant, at first while I say "hi" it returns "hi" working great. but if I say "hi, what time is it" it goes to the first if cause it finds the value "hi" in my sentence. This is a piece of my code: def run_alexa(): command = take_command() matches_hi =… Read More How do i ignore a the rest of a sentence that contains a word i want to print?
I installed the speech recognition and the pyttsx3 libraries pip install SpeechRecognition pip install pyttsx3 but when i try to import them it gives two errors Import "speech_recognition" could not be resolved Import "pyttsx3" could not be resolved heres my code import speech_recognition as sr import pyttsx3 audio = sr.Recognizer() >Solution : Usually this happens… Read More Import "speech_recognition" could not be resolved
SO here I imported pyttsx3 and wanted my ai to speak but it gave me a error full error here https://drive.google.com/file/d/12fa4KdSQ6JiEYjJHljc3JuLiFW-eYtKD/view?usp=sharing import pyttsx3 Assistant = pyttsx3.init(‘sapi.5’) voices = Assistant.getProperty(‘voices’) print(voices) Assistant.setProperty(‘voices’,voices(1).id) def Speak(audio): print(" ") Assistant.say(audio) print(" ") Assistant.runAndWait() Speak(‘Hello sir, I am Y.P.A’) >Solution : You have a typo when initializing your Assistant Assistant… Read More Can anyone tell me how to fix this error nomodulenaned pyttsx3.drivers.sapi full error here down