Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use PyAudio in MacOS M1. #714

Open
Nuna7 opened this issue Nov 21, 2023 · 1 comment
Open

Cannot use PyAudio in MacOS M1. #714

Nuna7 opened this issue Nov 21, 2023 · 1 comment

Comments

@Nuna7
Copy link

Nuna7 commented Nov 21, 2023

Hi, I have been trying to use SpeechRecognition module. Here is my code

`
import speech_recognition as sr

def real_time_speech_recognition():
recognizer = sr.Recognizer()

with sr.Microphone() as source:
    print("Say something or press 'q' to end.")

`

However, it keep on outputting the same error :

Traceback (most recent call last): File "/Users/nuntea/Documents/Vasundhara Geo technology/Voice recognition and NER/Real Time Speech recogntiion/RTSR.py", line 11, in <module> real_time_speech_recognition() File "/Users/nuntea/Documents/Vasundhara Geo technology/Voice recognition and NER/Real Time Speech recogntiion/RTSR.py", line 7, in real_time_speech_recognition with sr.Microphone() as source: File "/Users/nuntea/Documents/Vasundhara Geo technology/Voice recognition and NER/Real Time Speech recogntiion/myenv/lib/python3.9/site-packages/speech_recognition/__init__.py", line 80, in __init__ self.pyaudio_module = self.get_pyaudio() File "/Users/nuntea/Documents/Vasundhara Geo technology/Voice recognition and NER/Real Time Speech recogntiion/myenv/lib/python3.9/site-packages/speech_recognition/__init__.py", line 110, in get_pyaudio raise AttributeError("Could not find PyAudio; check installation") AttributeError: Could not find PyAudio; check installation

However, I have already install PyAudio.

`(myenv) nuntea@Zonunmawias-MacBook-Air Real Time Speech recogntiion % pip list
Package Version


certifi 2023.11.17
charset-normalizer 3.3.2
idna 3.4
keyboard 0.13.5
pip 23.3.1
PyAudio 0.2.14

requests 2.31.0
setuptools 69.0.0
SpeechRecognition 3.10.0
urllib3 2.1.0
wheel 0.41.3`

I have tried different method mention in stackoverflow and other resources but couldn't fixed it :

(myenv) nuntea@Zonunmawias-MacBook-Air Real Time Speech recogntiion % xcode-select --install xcode-select: error: command line tools are already installed, use "Software Update" in System Settings to install updates

(myenv) nuntea@Zonunmawias-MacBook-Air Real Time Speech recogntiion % brew install portaudio Warning: portaudio 19.7.0 is already installed and up-to-date. To reinstall 19.7.0, run: brew reinstall portaudio

(myenv) nuntea@Zonunmawias-MacBook-Air Real Time Speech recogntiion % pip3 install pyaudio Requirement already satisfied: pyaudio in ./myenv/lib/python3.9/site-packages (0.2.14)

Please help.

@UninspiredCarrot
Copy link

UninspiredCarrot commented Nov 24, 2023

Hi @Nuna7, I came across the same issue when I first used this library on my M1 Mac too, although I installed PyAudio the way it is described in the README. Below is the part in the docs I did to fix it, let me know if the issue still continues:

  • On OS X, install PortAudio using Homebrew <http://brew.sh/>: brew install portaudio. Then, install PyAudio using Pip <https://pip.readthedocs.org/>: pip install pyaudio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants