Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

pyaudio (Part 2)

juliettetworsey on Feb. 17, 2020

Hi Joe,

Thank you for this awesome course! I am really enjoying it.

I am encountering an issue when trying to record with pyaudio (and with python-sounddevice). I get this error when trying to run the script to record:

Python[35377:161495] Error loading /Library/Audio/Plug-Ins/HAL/Digidesign CoreAudio.plugin/Contents/MacOS/Digidesign CoreAudio: dlopen(/Library/Audio/Plug-Ins/HAL/Digidesign CoreAudio.plugin/Contents/MacOS/Digidesign CoreAudio, 262): no suitable image found. Did find: /Library/Audio/Plug-Ins/HAL/Digidesign CoreAudio.plugin/Contents/MacOS/Digidesign CoreAudio: no matching architecture in universal wrapper

I am on a macOS Mojave v10.14.6.

What could be the problem?

Thanks in advance for any advice:-)

Juliette

Joe Tatusko RP Team on March 2, 2020

Hi Juliette! How are you running your script? It seems like most of the CoreAudio and macOS issues I can find online aren’t necessarily related to Python, but to privacy permissions.

If you try running the script from a regular Terminal session does it prompt you to allow access to the microphone?

juliettetworsey on March 4, 2020

Hi Joe,

I am attempting to run the scripts from my iTerm terminal with:

python3 python_record_sounddevice.py

python3 python_record_pyaudio.py

I am not getting any prompt to allow microphone access. I suppose that this is due to some baked in settings/permissions macOS Mojave v10.14.6, but I can’t be sure.

I checked my preferences to make sure that iTerm has access to my microphone, but that doesn’t seem to make a difference.

I was unable to find a workaround when searching online.

I also noticed some other strange bug/behavior:

Even though I have loaded all of these modules (and have created a pipfile), when I try to run any of the scripts I am now getting an error (EX) ModuleNotFoundError: No module named 'playsound':

pipenv shell
pipenv install playsound
pipenv install PyObjC
pipenv install simpleaudio
pipenv install numpy
pipenv install soundfile
pipenv install sounddevice
pipenv install pydub simpleaudio
brew install ffmpeg
pipenv install ffmpeg-python

pipenv install pyaudio`//ERROR: Failed building wheel for pyaudio

brew update
brew install portaudio
brew link --overwrite portaudio

pipenv install pyaudio//2nd attempt initially succeeded 

pipenv install scipy

…hmmmm....not sure what to do, but I am going to attempt to start from scratch from within a Docker container and see if I get a different result.

Let me know if you have any ideas/thoughts on what could be wrong.

Thanks for getting back to me:-)

juliettetworsey on March 4, 2020

PS. For the sake of clarity…

Initially I was able to run the scripts to play back audio (just not record), but now (as mentioned above) my iTerm (in addition to the other issue initially mentioned) is no longer finding the modules…hope that makes sense.

Become a Member to join the conversation.