Created
December 19, 2016 18:09
-
-
Save bottomoftheheap9000/88c7f9c285517a2136b4534fc0d8ac8f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#from bing_voice import * | |
import speech_recognition 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 = "6864f2c3183842f3945ccf32d9bf1906" # 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)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment