V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
youthfire
V2EX  ›  问与答

有没有对 pyaudio 比较熟悉的朋友啊

  •  
  •   youthfire · Feb 12, 2023 · 751 views
    This topic created in 1182 days ago, the information mentioned may be changed or developed.
    audio = r.listen(source, timeout=10)

    麦克风录入

    这个 timeout 完全不起作用啊,总共都没有 10 秒,别说进入 silence 状态 10s 了。一会儿就停止了。
    而且没有设置 phrase_time_limit ,(哪怕设置 1000 )也是一样结果。

    如果用 duration 为某个固定数,倒是可以很长时间不停下的。但我并不想固定。
    Yourshell
        1
    Yourshell  
       Feb 12, 2023
    我们认识的是同一个 PyAudio 吗?哪里来的 listen 函数,自己封装的吧?
    youthfire
        2
    youthfire  
    OP
       Feb 12, 2023
    不好意思,应该是 speed_recognation 库,涉及了 PyAudio ,抱歉描述不周
    with sr.Microphone() as source:
    audio = r.listen(source, timeout=10)

    自己解决了
    在系统设置 sound 里,输入音量要调到最高,否则灵敏度不够,还要注意麦克风位置,比如 18mbp 在左边 shift 位置,挡住了效果就差了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4634 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 10:05 · PVG 18:05 · LAX 03:05 · JFK 06:05
    ♥ Do have faith in what you're doing.