speech recognition python code not working

后端 未结 13 1758
傲寒
傲寒 2020-12-15 10:23

I am running the following code in Python 2.7 with pyAudio installed.

import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:             


        
13条回答
  •  既然无缘
    2020-12-15 11:00

    I have solved the same problem for me with the following (noise suppression), The "listen" function has problems with environment noise. So the running code is only blinking waiting.

    Use this ambient noise suppression/adjustment; r.adjust_for_ambient_noise(source, duration=5)

    Referance Tuesday, March 28, 2017 Easy Speech Recognition in Python with PyAudio and Pocketsphinx

提交回复
热议问题