speech-recognition - 如何使用带有麦克风的模块(语音识别)进行即时转换
问题描述
import speech_recognition
r= speech_recognition.Recognizer()
with speech_recognition.Microphone() as source:
print("Please wait. Calibrating microphone...")
#listen for 5 seconds and create the ambient noise energy level
r.adjust_for_ambient_noise(source, duration=5)
print("Say something!")
audio= r.listen(source)
print("Google Speech Recognition thinks you said:")
result=r.recognize_google(audio, language="zh-TW")
print(result)
如何使用带有麦克风的模块(语音识别)进行即时转换。我尝试使用此模块将语音从计算机麦克风转换为脚本,但它只能在说出整个句子时进行转换。它可以逐字转换吗?
解决方案
推荐阅读
- javascript - 仅当 AJAX 返回成功时才切换复选框
- sapui5 - 在 sap.ui.table 中选择带有复选框的单行
- python - WRF Lambert Conformal Conic 如何转换为纬度/经度图偏移
- c++ - 使用 boost async_read 和 posix::stream_descriptor 从键盘读取
- java - Apache POI 是否支持对单词进行两次签名?
- svg - 将 Google 字体添加到 SVG 文件
- reactjs - 在 Typescript 中处理嵌套的可能为空的值
- batch-file - WshShell.SendKeys 不适用于 Alt+Enter
- javascript - 如何从动态创建的复选框 javascript 中制作复选框事件
- reactjs - React + Redux + JS SDK 事件