So for some reason whenever I try to play a sound with Psychopy3 on a given keypress, I can only play the sound once – the first time. I know that the key press event is being fired correctly, because my code does all the things associated with that event except for playing the sound (after the first time). Here’s some example code of what I’m doing:
from psychopy.sound import Sound # Window and stimulus setup omitted cSound = Sound('C', secs=0.1) aSound = Sound('A', secs=0.1) numFrames = 1000 for frame in range(numFrames): for key in event.getKeys(): if key in ['backslash', 'tab']: if key == 'backslash': # do some things... cSound.play() elif key == 'tab': # do some other things... aSound.play() win.flip()
Any ideas why the sounds aren’t playing more than once?