我使用recognize_google_cloud函数来使用Google Cloud Speech- to -TextAPI。将麦克风捕获的数据发送到GoogleAPI,并从一组备选方案中选择给定语音的最可能的转录。如本page of the documentation中所述,参数preferered_phrases用于选择包含所列单词的另一个备选方案。/__init__.py", line 933, in recognize_
我在安装了pyAudio的Python2.7中运行以下代码。import speech_recognition as srwith sr.Microphone() as source: #phrase and extract it into audio data
print("You said " + r.recognize(audio)) # recognize speechusing Google <e