So I'm playing around with the speech recognition python software:
#! /usr/bin/python
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source: # use the default microphone as the audio source
audio = r.listen(source) # listen for the first phrase and extract it into audio data
try:
print("You said " + r.recognize(audio)) # recognize speech using Google Speech Recognition
except LookupError: # speech is unintelligible
print("Could not understand audio")
Now, this works surprisingly well and is extremely fun to fool around with, but unfortunately on some versions of Ubuntu there's an unavoidable and unappealing bluetooth error message that prints about 6 times everytime that r.listen(source) is run.
Is there a way to hide that rubbish output from r.listen(source) and still have my print statements bellow work???