speech_recognition
speech_recognition copied to clipboard
installing pyaudio
Steps to reproduce
- (How do you make the issue happen? Does it happen every time you try it?)
- (Make sure to go into as much detail as needed to reproduce the issue. Posting your code here can help us resolve the problem much faster!)
import speech_recognition as sr import pyaudio
r = sr.Recognizer()
with sr.Microphone() as source: print("can u speak??") text = r.listen(source)
try:
recognised_text = r.recognize_google(text)
print("recognised text")
except sr.UnknownValueError:
print("value error")
except sr.RequestError as e:
print("request error")
- (If there are any files, like audio recordings, don't forget to include them.)
Expected behaviour: program should run successfully
(What did you expect to happen?)
Actual behaviour: in get_pyaudio raise AttributeError("Could not find PyAudio; check installation") AttributeError: Could not find PyAudio; check installation
(What happened instead? How is it different from what you expected?)
(If the library threw an exception, paste the full stack trace here)
System information
(Delete all the statements that don't apply.)
My system is <INSERT SYSTEM HERE>. (For example, "Ubuntu 16.04 LTS x64", "Windows 10 x64", or "macOS Sierra".)
My Python version is <INSERT VERSION HERE>. (You can check this by running python -V
.)
My Pip version is <INSERT VERSION HERE>. (You can check this by running pip -V
.)
My SpeechRecognition library version is <INSERT VERSION HERE>. (You can check this by running python -c "import speech_recognition as sr;print(sr.__version__)"
.)
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: (You can check this by running python -c "import speech_recognition as sr;print(sr.Microphone.list_microphone_names())"
.)
My working microphones are: (You can check this by running python -c "import speech_recognition as sr;print(sr.Microphone.list_working_microphones())"
.)
I installed PocketSphinx from <INSERT SOURCE HERE>. (For example, from the Debian repositories, from Homebrew, or from the source code.)
(base) c:>conda install PyAudio Collecting package metadata (current_repodata.json): done Solving environment: done
Package Plan
environment location: C:\ProgramData\Anaconda3
added / updated specs: - pyaudio
The following packages will be downloaded:
package | build
---------------------------|-----------------
portaudio-19.6.0 | he774522_4 202 KB
pyaudio-0.2.11 | py38he774522_2 206 KB
------------------------------------------------------------
Total: 408 KB
The following NEW packages will be INSTALLED:
portaudio pkgs/main/win-64::portaudio-19.6.0-he774522_4 pyaudio pkgs/main/win-64::pyaudio-0.2.11-py38he774522_2
having some problems with pyaudio, saying device in unavailable (OS Error)??? Never experienced this before and I don't know why it's happening.
having some problems with pyaudio, saying device in unavailable (OS Error)??? Never experienced this before and I don't know why it's happening.
I am also getting the same error OSError: [Errno -9985] Device unavailable. If you solve this problem........ please help me
I fixed the problem, the solution is to check your microphone settings and then make sure that more than one app can access it or something