简体   繁体   English

语音识别音量

[英]Speech recognition volume of voice

I have a very sensitive microphone and even when I whisper I can hear clearly what I am saying but when I use this library I almost have to scream.我有一个非常敏感的麦克风,即使我低声说话,我也能清楚地听到我在说什么,但是当我使用这个库时,我几乎不得不尖叫。 Any ideas.有任何想法吗。 Without adjust_for_ambient_noise , the code is in an endless loop.如果没有adjust_for_ambient_noise ,代码将处于无限循环中。

import speech_recognition as sr

listener=sr.Recognizer()

try:
    with sr.Microphone(device_index=1) as source:
        print("start")
        listener.adjust_for_ambient_noise(source)
        voice=listener.listen(source,timeout=5)
        print("stop")
        command = listener.recognize_google(voice)
        print(command)
except Exception as e:
    print(e) 

The first thing I would do here is make sure that the Microphone source is the expected source.我在这里要做的第一件事是确保麦克风源是预期的源。 Is any other microphone connected?是否连接了其他麦克风? Is there some way with the speech_recognition package that you could play back what has been recorded so that you know exactly what the sr.Microphone() function is getting as input? speech_recognition package 是否有某种方法可以播放已录制的内容,以便您确切知道sr.Microphone() function 得到什么作为输入?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM