【发布时间】:2020-09-05 06:59:49
【问题描述】:
我正在尝试使用 python 中的语音识别和 pyaudio 将语音转换为文本。它在转换预先录制的音频文件时工作正常,但是当我使用麦克风(外部)录制时,它没有在听而是显示:
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(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
这是我的代码:
import speech_recognition as sr
r = sr.Recognizer()
mic = sr.Microphone()
with mic as source:
print('say somthing')
audio = r.listen(source)
print(r.recognize_google(audio))
【问题讨论】:
-
我什至看不到我的演讲文本
标签: python artificial-intelligence speech-to-text pyaudio