I've encountered an odd bug using psychopy recently, where my script does not kill psychopy when it is terminating.
This only happens when I add a sound to my routine and when I make psychopy generate a sound or play a sound from a file. In other words, just loading sound
from psychopy does not result in my script being unable to quit. Only when I make a call to a sound as in s=sound.Sound(value="C", secs=0.15)
, and even if that sound ins't actually played in my routine by s.play()
I've tried googling to see if other people reported this issue but it seems I'm kinda lonely. I've tested it on two Macs specs below:
MacBook Pro runs:
- OSX Yosemite
- enthought python 2.7
- latest psychopy (recently installed with
easy_install
) - pyglet 1.2
- pyo 0.7.5
- Intel Iris graphics card/built in
iMac runs:
- everything similar to above
- NVIDIA separate graphics card (don't remember model right now)
Here is some example code I am running. Does this quit fine for you? Does anyone have suggestions regarding what might be going on? Let me know if more info is needed about my system etc.
#Display a text together with a sound synced
#to the onset of the visual display
#---------------------------------------------
from psychopy import core, visual,sound
win = visual.Window([800,800], color='gray', allowGUI=False, winType='pyglet', monitor='testMonitor',units='pix')
stim = visual.TextStim(win, text="Hi!")
s=sound.Sound(value="C", secs=0.15)
startText=visual.TextStim(win, text="starting")
startText.draw()
win.flip()
core.wait(1)
for i in xrange(2):
for frameN in range(70):
stim.draw()
if frameN == 0:
win.flip()
s.play()
else:
win.flip()
win.flip()
core.wait(.2)
Thanks :)