speech_recognition
speech_recognition copied to clipboard
unable to open slave
Steps to reproduce
i try to run the code:
#!/usr/bin/env python3
import sys, os
import time
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source: # use the default microphone as the audio source
audio = r.listen(source) # listen for the first phrase and extract it into audio data
try:
print("You said " + r.recognize(audio)) # recognize speech using Google Speech Recognition
except LookupError: # speech is unintelligible
print("Could not understand audio")
Expected behaviour
Run program without error and recognise speech.
Actual behaviour
What happened instead?
ALSA lib pcm_dsnoop.c:606:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_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_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
now i start jackd and message is:
ALSA lib pcm_dsnoop.c:606:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_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_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave Cannot lock down 82274202 byte memory area (Cannot allocate memory)
and stay locked, no more answer.
System information
My OS is "Ubuntu 16.04 LTS x64"
My Python version is 3.5
My Pip version is 3.5
My SpeechRecognition library version is 3.8.1
My PyAudio library version is <INSERT VERSION HERE> / I don't have PyAudio installed. (You can check this by running python -c "import pyaudio as p;print(p.__version__)"
.)
My microphones are:
Microphone with name "HDA Intel PCH: ALC269VB Analog (hw:0,0)" found for Microphone(device_index=0)
Microphone with name "HDA Intel PCH: HDMI 0 (hw:0,3)" found for Microphone(device_index=1)
Microphone with name "sysdefault" found for Microphone(device_index=2)
Microphone with name "hdmi" found for Microphone(device_index=3)
Microphone with name "pulse" found for Microphone(device_index=4)
Microphone with name "default" found for Microphone(device_index=5)
Microphone with name "/dev/dsp" found for Microphone(device_index=6)
I **installed PocketSphinx from official repositories
was it solved?