Audio Recording Creating Empty .wav Files

344 views
Skip to first unread message

Brice Roberts

unread,
Aug 5, 2015, 7:25:41 PM8/5/15
to psychopy-users
Hi there,

I'm a linguist that is running an experiment which requires the recording of participants' vocal responses to certain stimuli. I'm using the builder on the newest version of PsychoPy, and I run Windows 10 on my own machine, though the exact same problem happens regardless of the computer I run it on (the others run Windows 7). The experiment runs fine with no hiccups. The data folder holds a subdirectory which has all the "recorded" .wav files for each trial just as planned; however, all of them have a null duration, as if the microphone was not activated. I'm relatively new to coding, and so don't have a great idea as to where to look to see if the microphones I'm using are being recognized by the program, though I am always sure to set the microphone in use to the default recording device for the computer. Each run, whether aborted or not, gives this error message: 

Exception TypeError: "'NoneType' object is not callable" in <bound method Server.__del__ of <pyolib.server.Server object at 0x04DACC90>> ignored

Has anyone encountered a problem like this? What options do I have to troubleshoot so that I can record my participants' responses? 

Thanks for your time and expertise!

Jeremy Gray

unread,
Aug 5, 2015, 7:46:25 PM8/5/15
to psychop...@googlegroups.com
Hi Brice,

Welcome to PsychoPy.

I'm a linguist that is running an experiment which requires the recording of participants' vocal responses to certain stimuli. I'm using the builder on the newest version of PsychoPy, and I run Windows 10 on my own machine, though the exact same problem happens regardless of the computer I run it on (the others run Windows 7).

Thanks for the detail. I only have access to a Mac at this point, but recording is certainly supposed to work the same way on all platforms (and I believe it does so).
 
The experiment runs fine with no hiccups. The data folder holds a subdirectory which has all the "recorded" .wav files for each trial just as planned;

Good so far
 
however, all of them have a null duration, as if the microphone was not activated. I'm relatively new to coding, and so don't have a great idea as to where to look to see if the microphones I'm using are being recognized by the program, though I am always sure to set the microphone in use to the default recording device for the computer.

I agree this would be good to verify, not just assume.
 
Each run, whether aborted or not, gives this error message: 

Exception TypeError: "'NoneType' object is not callable" in <bound method Server.__del__ of <pyolib.server.Server object at 0x04DACC90>> ignored

The above exception is annoying but not informative, nor of itself cause for concern. 
 
Has anyone encountered a problem like this?

Yes, I've seen it, and think several different things might be causing it for you.
 
What options do I have to troubleshoot so that I can record my participants' responses? 

First, I would make yourself a minimal experiment to play around with: a single routine with a microphone component (2s record) and a text component (2s text, just so you can see when the mic should be recording). Add a loop around that, with one repetition, in order to force it to save the data.

Also add a code component to that routine, and in Begin Exp box put the following 3 lines:
import pyo
print('defaults: '+repr(pyo.pa_get_devices_infos()))
print('mic: '+repr(pyo.pa_get_default_input()))

This will show you what defaults are being seen by your experiment.

--Jeremy

benjami...@uni-graz.at

unread,
Apr 26, 2016, 8:36:32 AM4/26/16
to psychopy-users
Hi all,

this post is old but since I also encountered the problem of audiorecording failing I want to share a little 'trick' for everybody using pyo and not pygame.
My paradigm worked fine on my workstation but on the presentation PC it just crashed as soon as audiorecording should commence.

Trick: go to PsychoPy Preferences, then go to the 'General' tab. Make sure that the order of the followind list is like this: ['pyo','pygame']. Or delete 'pygame' entirely from the list.
Otherwise PsychoPy will use pygame sound and throw errors.

If PsychoPy is installed anew (Standalone) the above setting is set back to default (e.g. ['pygame','pyo']). Also check (and set) required parallel ports if you use them.

In case your recording device is not set to default recording device, produced wav files will be silent. In my case they were of normal duration.


Best regards,

Benjamin
Reply all
Reply to author
Forward
0 new messages