2

I'm generating an experiment in PsychoPy (v1.84.2 on Windows 7), which requires a short tone. The lines of code around the sound generation are:

print '1'
startTone = sound.Sound(value='B', secs=0.15, octave=5, sampleRate=44100, bits=16, name='', autoLog=False)
print '2'
instructions_text_stim = visual.TextStim(win, text='Press any key to start.', pos = [0,0], height=2)
print '3'
instructions_text_stim.draw()
print '4'
win.flip()
print '5'

PsychoPy crashes as soon as the visual.TextStim is drawn (I get 1-3 in the output window). The crash is a "pythonw.exe has stopped working" popup, which forces the window to be closed. Without the sound generation, the experiment runs without a hitch. The tone is played elsewhere in the script, but the crash is at the assignment. Additionally, the code runs on OSX.

I've seen people have had issues with pyo compatibility before, as well as the pythonw.exe crash. Has anyone had the combination, or found a work-around?

Thanks

JAP
  • 21
  • 1
  • Have you tried changing to another sound backend? https://discourse.psychopy.org/t/python-crashing-with-sound-heavy-experiment/2029 – Michael MacAskill Mar 02 '17 at 20:41
  • The link there was very useful: pysoundcard resulted in a very unusual sound playing once, and then not again, but the problem was solved entirely by using portaudio with pyo. Thanks! – JAP Mar 02 '17 at 21:44
  • Update: problem was only fixed temporarily. However, new audio lib sounddevice included with PsychoPy v1.85.0 seems to be working much better. Only time will tell! Thanks for your help though. – JAP Mar 03 '17 at 01:47
  • Great. Could you add that as an answer here and accept it? (It is fine to ask and answer your own question). Might be a useful guide to others. – Michael MacAskill Mar 03 '17 at 02:56

1 Answers1

0

Updating to PsychoPy v1.85.0 and using the audio library "sounddevice" fixed this issue.

JAP
  • 21
  • 1