0

pls answer python about speech recognition

import pywhatkit as pwk import random as rd import time as tm import speech_recognition as sr import keyboard as kb listener= sr.Recognizer() try: with sr.Microphone() as source: print('say something') voice=listener.listen(source) cmd=listener.recognize_google(voice) print(cmd) except: pass thats my code why doesn't it stop listening it doesn't print the text

31st Dec 2020, 3:03 AM
Ireneo language
2 ответов
0
Maybe, you have to put the time in (voice=listener.listen(source, 5)) forget if it was milliseconds or seconds, you have to try out
2nd Jan 2021, 10:38 PM
christian
0
Thanks
3rd Jan 2021, 3:50 AM
Ireneo language