gpt4 book ai didi

linux - PyAudio 打印 ALSA 警告并且不起作用

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:46:56 27 4
gpt4 key购买 nike

我正在尝试运行一个基本的 python 语音到文本代码。这是代码。

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

try:
print("You said " + r.recognize(audio))
except LookupError:
print("Could not understand audio")

代码在到达打印阶段之前工作正常,然后抛出此错误。我做错了什么吗?

ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map

最佳答案

如果有人还在寻找摆脱

ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map

我刚刚在“PCM 接口(interface)”部分注释掉了所有 pcm.surround* 行

/usr/share/alsa/alsa.conf

文件,它对我来说很好用。

关于linux - PyAudio 打印 ALSA 警告并且不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42504581/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com