# Pymedia audio recording error in MacOS \> 10.14

**URL:** <https://discourse.psychopy.org/t/pymedia-audio-recording-error-in-macos-10-14/22718>\
**Category:** Builder\
**Created:** [May 2, 2021, 9:02am UTC](https://discourse.psychopy.org/t/pymedia-audio-recording-error-in-macos-10-14/22718 "2021-05-02T09:02:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cnsla](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/cnsla/32/6292_2.png) [@cnsla](https://discourse.psychopy.org/u/cnsla)\
**Post date:** [May 2, 2021, 9:02am UTC](https://discourse.psychopy.org/t/pymedia-audio-recording-error-in-macos-10-14/22718/1 "2021-05-02T09:02:01Z")

</div>

In MacOS \>10.14, the security option requires permission to access microphone.

I could find several posts about it.

> [@Problem importing pyaudio](https://discourse.psychopy.org/t/problem-importing-pyaudio/8799):
>
> I’m having a basic problem importing pyaudio in the coder interface. I’m using the pydub library to shift the pitch of a pulse train, with the goal of shifting the pitch while a stream is playing in response to user input. My error message comes specifically when I load pyaudio. I have it working if I run the code in the Terminal. But When I run it in PsychoPy I get the following: Traceback (most recent call last): File “[…]/PSY\_AUGtest.py”, line 3, in (module) import pyaudio ModuleNotFound…

> [@Microphone creating file but no sound](https://discourse.psychopy.org/t/microphone-creating-file-but-no-sound/8015):
>
> PsychoPy2 v1.85.4 I’m trying to get the microphone to work without any luck. I’ve got it to the point where a .wav file is saved. The file is the appropriate duration, but it is silent (just as has been reported [here](https://discourse.psychopy.org/t/microphone-recording-but-no-sound/5587/2) and [here](https://discourse.psychopy.org/t/microphone-does-not-record-sounds/6959)). I’ve even tried the hacky solution I found [here](https://groups.google.com/forum/#!topic/psychopy-users/SMk7zFwtHGg) but couldn’t get it to work either (I end up with a zero-byte wav file). Does anyone have a solution to this?

> [@Pyo not found with catalina (mac)](https://discourse.psychopy.org/t/pyo-not-found-with-catalina-mac/11691):
>
> If this template helps then use it. If not then just delete and start from scratch. OS (e.g. Win10): Catalina (Mac) PsychoPy version 2020.1.3 Standard Standalone? (y/n) If not then what?: Standalone What are you trying to achieve?: recording using microphone What did you try to make it work?: from psychopy import microphone, sound What specifically went wrong when you tried that?: ImportError: sys.meta\_path is None, Python is likely shutting down Exception ignored in: \<bound method Te…

> [@PsychoPy3 & microphone problems on a Mac 10.15.4 computer](https://discourse.psychopy.org/t/psychopy3-microphone-problems-on-a-mac-10-15-4-computer/11927):
>
> Hi everyone, I’m in the process of designing an experiment, where a visual stimulus appears in different positions on a screen according to the acoustic properties of a vocalisation. In order to get started on programming for the rest of the experiment, PsychoPy needs access to the microphone and to open a microphone stream; however, when I run even just a simple script, it returns the following ‘ApplePersistenceIgnoreState’ error: First part of the returned error:

After manually install pyaudio and pymidi via homebrew, the error message gone, but the file is empty wave file.

I guess the .plist should contain lines to ask microphone permission explicitly, but adding NSMicrophoneUsageDescription  
to info.plist had no luck.

Any success on resolving this?  
It seems the only solution is using 10.13.X, for now.

**OS** (e.g. Win10): MacOS \>10.14  
**PsychoPy version** (e.g. 1.84.x):  
**Standard Standalone? (y/n)** If not then what?:y  
**What are you trying to achieve?:**

**What did you try to make it work?:**  
moded plist, install pyaudio, pymidi via homebriew… than no luck.  
**What specifically went wrong when you tried that?:**  
-without homebrew pyaudio, pymidi, error message about cannot find pyaudio .dylib file.  
-with homebrew pyaudio, pymidi, creates recorded file, but all empty.  
Include pasted full error message if possible. “That didn’t work” is not enough information.
