Open ploveaiit opened 6 years ago
The error says your function was not able to get the microphone. Most likely the microphone is occupied by one thread (e.g., snowboy) and you are trying to use it in another (e.g., your recognizer)
What should I do to fix this problem ?
Are you using Raspbian?
Yes I am using Raspbian Debian 9
Go to start. In preferences select audio device. Then select sound card. Select all the options one by one. If you find Microphone and auto gain control in one of them, then that is your microphone. Select both the options. In the capture tab, set your microphone volume to full, and In switches, enable auto gain control.
I do all but still got same error @Sanjit1
Have you installed all the dependencies? Install these : SoX: sudo apt-get install sox libsox-fmt-all PortAudio: sudo apt-get install python-gnuradio-audio-portaudio SWIG 3.0.10: git clone https://github.com/swig/swig.git && cd swig && ./autogen.sh && ./configure && make && sudo make install
OpenBLAS: sudo apt-get install git python-dev gfortran && cd ~/src && git clone https://github.com/xianyi/OpenBLAS && cd OpenBLAS && make FC=gfortran && sudo make PREFIX=/opt/openblas install
I can install SoX, SWIG and OpenBLAS but I cannot install python-gnuradio-audio-portaudio
sudo apt-get install python-gnuradio-audio-portaudio
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-gnuradio-audio-portaudio
Try sudo apt-get install libasound-dev ./configure && make sudo make install
I get this error
E: Unable to locate package python-gnuradio-audio-portaudio
when i ran sudo apt-get install python-gnuradio-audio-portaudio
run snowboy and detected hotword then call my function
and then I got this error "IOError: [Errno -9985] Device unavailable"
code in my callback function
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
audio = r.listen(source)
thank you for your help