Audio experiment sometimes freezes

I’m doing a same-different task with audio files (two are played and participants have to decide if the were the same or different).

I have the problem that sometimes the experiment freezes and doesn’t continue, but I have no clue why. All settings are correct. This is the only message I get in the console:

Generating PsychoPy script...
## Running: [path removed] ##
pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
5.7093     WARNING     User requested fullscreen with size [1097  617], but screen is actually [1920, 1080]. Using actual size
8.3012     WARNING     Hamming was requested using the 'pygame' sound library but hamming is not supported there.
8.3039     WARNING     Hamming was requested using the 'pygame' sound library but hamming is not supported there.

What could be the cause of these freezes?

Edit: It appears that it might not be the audio that causes it, but a problem with the setup of my experiment in general. Participants are supposed to have 2.5 seconds to respond, and if they don’t respond the experiment moves to the next item. To do this, I use this code snippet (for Each Frame):

if reminder == STARTED and t >= 4.95:
   keyboard.Keyboard(False)

But it’s not working, and I’m not sure why.

Here’s the setup of my trial, in case it helps:

@mariee, to end your routine conditionally, you would use the following:

if reminder == STARTED and t >= 4.95:
   continueRoutine = False

Thanks for the response! I replaced the code, but I still have the same problem :frowning:
If there’s no response within the allocated time, then the screen goes grey and the experiment doesn’t respond anymore.

Ah, I thought reminder was one of your variables, but it is a text component. Try:

if reminder.status == STARTED and t >= 4.95:
   continueRoutine = False

Now it works! Thanks so much! :blush: