hi i have a code that gives me an ALSA error so here is the code and i tried everything that i have known .farther more i installed and tried everything so if you can help it would be a fantastic opportunity for us to know each other so i can learn alot from you because i am still a beginner
so here is the code
import webbrowser
import string
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
print("Hello, what can i help you find?[Player lookup,Weather,resturants, or just to search the web: ]")
audio = r.listen(source)
if "player" in r.recognize_google(audio):
# obtain audio from the microphone
r2 = sr.Recognizer()
url = 'https://en.wikipedia.org/wiki/'
with sr.Microphone() as source:
print("Say any sports players name to see there Bio: ")
audio2 = r2.listen(source)
try:
print("Google Speech Recognition thinks you said " + r2.recognize_google(audio2))
webbrowser.open_new(url+r2.recognize_google(audio2))
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))
if "weather" in r.recognize_google(audio):
# obtain audio from the microphone
r3 = sr.Recognizer()
url3 = 'https://www.wunderground.com/us/'
with sr.Microphone() as source:
print("Please say a city and state: ")
audio3 = r3.listen(source)
try:
print("Google Speech Recognition thinks you said " + r3.recognize_google(audio3))
webbrowser.open_new(url3+r3.recognize_google(audio3))
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))
if "restaurants" in r.recognize_google(audio):
# obtain audio from the microphone
r4 = sr.Recognizer()
url4 = 'https://www.yelp.com/search?cflt=restaurants&find_loc='
with sr.Microphone() as source:
print("Please state a location to search for restaurants: ")
audio4 = r4.listen(source)
try:
print("Google Speech Recognition thinks you said " + r4.recognize_google(audio4))
webbrowser.open_new(url4+r4.recognize_google(audio4))
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))
if "search" in r.recognize_google(audio):
# obtain audio from the microphone
r5 = sr.Recognizer()
with sr.Microphone() as source:
print("what website would you like me to search for you? ")
audio5 = r5.listen(source)
url5= r5.recognize_google(audio5)
try:
print("Google Speech Recognition thinks you said " + r5.recognize_google(audio5))
webbrowser.open_new("https://"+url5+".com")
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))
and here is the error
ALSA lib pcm_dsnoop.c:606:(snd_pcm_dsnoop_open) unable to open slave
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
Hello, what can i help you find?[Player lookup,Weather,resturants, or just to search the web: ]
so if you can help i would be more than happy and thanks for your time