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)
如何使用带有麦克风的模块(语音识别)立即进行转换。 我尝试使用此模块将语音从计算机麦克风转换为脚本,但是当说完整个句子时,它就可以转换。 可以立即逐字转换吗?