Skip to content

Commit

Permalink
Add time limit for speech recognition
Browse files Browse the repository at this point in the history
  • Loading branch information
bkbilly committed Sep 26, 2023
1 parent cabf293 commit 06f6e60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lnxlink/modules/speech_recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def start_recognition(self):
try:
recognizer = sr.Recognizer()
with sr.Microphone() as source:
audio = recognizer.listen(source)
audio = recognizer.listen(source, timeout=2, phrase_time_limit=4)
self.speech = recognizer.recognize_google(audio)
except Exception as err:
logger.error("Error with speech recognition: %s", err)
Expand Down

0 comments on commit 06f6e60

Please sign in to comment.