My code is
import SpeechRecognition as sr
# obtain audio from the microphone
r = sr.Recognizer()
with sr.Microphone() as source:
print("Say something!")
audio = r.listen(source)
# recognize speech using Microsoft Bing Voice Recognition
BING_KEY = "Somevalue" # Microsoft Bing Voice Recognition API keys 32-character lowercase hexadecimal strings
try:
print("Microsoft Bing Voice Recognition thinks you said " + r.recognize_bing(audio, key=BING_KEY))
except sr.UnknownValueError:
print("Microsoft Bing Voice Recognition could not understand audio")
except sr.RequestError as e:
print("Could not request results from Microsoft Bing Voice Recognition service; {0}".format(e))
When I run it, I got
ImportError: No module named SpeechRecognition
I think I did install this module:
>pip list
SpeechRecognition (3.6.5)
the code given by the git repository is like this
import speech_recognition as sr
but it isn't working either
I think the problem is
import SpeechRecognition as sr
where you should use
import speech_recognition as sr
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With