| Reference | Downloads | Github

Microphone makes TextStim crash interpreter?

Sorry for creating two posts in two days, but I’m stumped here…

The following script should print “Hello”, allocate a TextStim, print “Survived!”, and exit. However, it crashes the interpreter when it tries to allocate the TextStim!

from psychopy import visual,core,event,logging,sound,microphone
win = visual.Window(fullscr=True,color='black',screen=0)
clock = core.Clock()
print "Hello"
print "Survived!"
assert False

The worrying thing is that, if you comment out the microphone line, it works without a problem!

This is on Win7 x64 using PsychoPy 1.84.2. It also happens on PsychoPy 1.85.2, but there you need to patch PsychoPy using instructions here: Voice capture crashes to work around AttributeError: 'NoneType' object has no attribute 'getSamplingRate'.

I could really, really use some help here :frowning:
I really need both text and microphone!

Please post the specific error messages you see.

I suspect the TextStim is not really an issue here. According to the docs, it can take a few seconds for .switchOn() to take effect, so it might be that the crash is going to happen regardless of what you try to do next (so it just looks like it is related to creating a TextStim).

Try replacing everything after that line with core.wait(60) and see what happens. But regardless, we need to see the error messages.

Apologies, should have posted the actual trace from the get go. Here it is:

pyo version 0.8.0 (uses single precision)
29.5117         WARNING         Monitor specification not found. Creating a temp
orary one...
29.5125         WARNING         User requested fullscreen with size [800 600], b
ut screen is actually [1680, 1050]. Using actual size
Fatal Python error: (pygame parachute) Segmentation Fault

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

(followed by the standard Windows 7 ‘python.exe has stopped working’)

Adding a core.wait(60) right after the first print does not change the behavior: the interpreter still crashes upon reaching the TextStim. If I comment out everything after the core.wait(60), the interpreter exits normally, as expected.