小编Cha*_*yan的帖子

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

我正在尝试运行一个基本的 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")
Run Code Online (Sandbox Code Playgroud)

代码运行良好,直到到达打印阶段,然后抛出此错误。有什么我做错了吗?

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
Run Code Online (Sandbox Code Playgroud)

linux alsa speech-to-text python-3.x

2
推荐指数
1
解决办法
9632
查看次数

标签 统计

alsa ×1

linux ×1

python-3.x ×1

speech-to-text ×1