Voice capture crashes

Hi everyone!
OS: OSX El Capitan 10.11.6
PsychoPy version: 1.85.1
Standard Standalone? (y/n): Yes

I just updated Psychopy 2 to version 1.85.1. When trying to check for proper hardware function by running the demo “voiceCapture”, I get the following error message:

2017-04-19 12:58:29.604 python[1137:221943] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/r_/cxrr8dr97dl2nc_vpnn7kbr40000gn/T/org.psychopy.PsychoPy2.savedState
Traceback (most recent call last):
File “/Users/marcos/Documents/PsychoPy2 Demos/voiceCapture/voiceCapture_lastrun.py”, line 199, in
mic = microphone.AdvAudioCapture(name=‘mic’, saveDir=wavDirName, stereo=False)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/microphone.py”, line 357, in init
self.setMarker()
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/microphone.py”, line 402, in setMarker
sampleRate = sound.pyoSndServer.getSamplingRate()
AttributeError: ‘NoneType’ object has no attribute 'getSamplingRate’
Exception TypeError: “‘NoneType’ object is not callable” in <bound method Server.del of <pyolib.server.Server object at 0x1119c3c10>> ignored

I’d appreciate it if you could tell me what may not be set up properly to capture sound.
BTW, the mic is on and this did not happen with version 1.84.

Best regards,

Marcos

Is there anyone there who could help me out or give me a hint?

Hi Marcos,

Could you try changing the first entry in the audio library list (PsychoPy preferences > General) to ‘sounddevice’ rather than ‘pyo’?

Hi Michael,

Thanks for answering. I tried what you suggested and I still get the same message after relaunching the program.

What about ‘pysoundcard’?

EDIT: actually looking here: What would it take to replace pyo? I’m not sure that the new alternative sound backends work for recording.

Have you tried using the older ‘pygame’?

Hi Michael,

I’m actually having the exact same problem. I’ve tried using ‘pyo’, ‘pygame’, ‘sounddevice’, and ‘pysoundcard’ in preferences > General, but for some reason it hasn’t been working. When I use ‘sounddevice’ or ‘pysoundcard’, it instead says ‘AttributeError: pyo server not created’. Are there any other audio library list entries that might be recommended?

Thank you in advance for any help on this!

Had the same issue (v1.85.1). Seems like pyoSndServer is not being created properly. You can try simply replacing the calls to sound.pyoSndServer.getSamplingRate() in microphone.py with the precise sample rate you’re using, most likely 48000. This gets it to record on my install at least. Haven’t checked that all the microphone methods work though.

I try fixing the same problem. Could you please explaine how to do what you suggested?

What if it says I don’t have permission to make the modification?!

I have the same problem. Has anyone found a good solution to this yet?