H
H
Herman Hacker2019-12-18 22:20:53
Python
Herman Hacker, 2019-12-18 22:20:53

What to do with SpeecRecogniter?

Faced here with such problem: the speech is written off but does not reach if why?

while True:
  init()
  engine = pyttsx3.init()
  engine.say("Что открыть - Калькулятор, Вконтакте , Ютуб, Игра , Фигура, Погода ?")
  engine.runAndWait()
  print(Fore.GREEN)
  r = sr.Recognizer()
  with sr.Microphone(device_index=1) as source:
    print("Что открыть - Калькулятор(1), Вконтакте(2), Ютуб(3), Игра(4), Фигура(5), Погода(6) ,выход(0) ?")
    audio = r.listen(source)
  query = r.recognize_google(audio, language = "ru-RU")
  x = input(query)
  if x =="калькулятор" or x == "1":
    while True:
      print(Fore.YELLOW)
      engine.say("Что будем делать ?")
      engine.runAndWait()
      f=input("Что будем делать ? (+,-,*,/,**,//(корень) )")
      if f == "+":

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PxNxD, 2019-12-19
@omaxkarpov

Why x = input(query) , shouldn't it be - x = query

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question