From 1b6ea0cdedf0e92ccc667082569c6303fc44ad1e Mon Sep 17 00:00:00 2001 From: Sandro Zimmermann Date: Sat, 6 Dec 2025 13:47:19 +0100 Subject: [PATCH] offilne speech recogintion --- py/speech.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/py/speech.py b/py/speech.py index c557f7a..2f85b05 100644 --- a/py/speech.py +++ b/py/speech.py @@ -2,12 +2,10 @@ import speech_recognition as sr recognizer = sr.Recognizer() with sr.Microphone() as source: - print("Speak something...") + print("Say something...") audio = recognizer.listen(source) try: - text = recognizer.recognize_google(audio) - print("You said: {}".format(text)) + text = recognizer.recognize_sphinx(audio) + print("Sphinx recognized: {}".format(text)) except sr.UnknownValueError: print("Could not understand audio.") - except sr.RequestError as e: - print("Error with API: {}".format(e))