th efollowing code ,
import speech_recognition as sr
def SpeechToText():
r = sr.Recognizer() # Speech recognition
with sr.Microphone() as source:
print("Say something!")
audio = r.listen(source)
msg = r.recognize_google(audio)
print("Check: " + msg)
try:
print("User: " + r.recognize_google(audio))
except sr.UnknownValueError:
print("Google Speech Recognition could not understand audio")
except sr.RequestError as e:
print("Could not request results from Google Speech Recognition service; {0}".format(e))
return msg
message = SpeechToText()
print(message)
i get this error
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
how to fix it?
It looks like u tried to install google assistant, i ever tried on my raspberry pi and got this error. All u need to do is in alsa.conf
Обсуждают сегодня