All audio stimuli not playing in loop online

URL of experiment: onlineRecognitionExperiment [PsychoPy]

Description of the problem:
I’m having issues with playing audio inside a loop online. Similar issues have been discussed in other posts such as: Audio loop not working online. However, the solutions provided in this as well as other discussions/posts have not worked for me, at least fully.

First, I tried to change the starting point of the sounds to be something other than 0. This didn’t work, so I tried the other solution provided in the previous link (stim1_2.setValue(440); stim1_2.setValue(fname);). Adding this code made most of the sounds work correctly, but still didn’t fix the issue for all sounds. I was originally working with wav-files but switched to mp3 in case that would help. Unfortunately, that did not change anything either.

I added a print-statement to the code so that I could check whether all sounds are defined correctly. Even for the sounds that don’t play, the name of the sound file is always correctly printed. I also don’t get any errors on the console when running the experiment. In addition to this, the sounds that don’t play change depending on the browser I’m using and are not necessarily even consistent in one browser (for example, one sound may work once but then not the second time while still using the same browser). Surprisingly enough, Safari is the only browser that plays all sounds correctly. Google Chrome and Firefox do not work properly. I am working on a Mac so I don’t know if that is in some way related.

I will happily share my code if requested, but would rather not make it publicly available to everyone at this point (as I’m not sure whether I’m even allowed to do that…). I’ve been struggling with these sound problems for quite a while and would appreciate any advice you might have!

Hi There,

Could you please share the .psyexp file used to make the experiment?

Is it that the same stimulus is supposed to presented repeatedly (via the loop) or different stimuli on each iteration of the loop?

Is there a response component that could end the routine before the sound has had a chance to stop?


Yes of course!
onlineRecognitionExperiment.psyexp (63.3 KB)

Each iteration has a different stimulus. These are defined in the condition file for the loop.

Yes, the subjects move ahead by clicking one of the images each time.

Please may you try adding a code component and in the Begin Routine tab add the snippet soundAnimal.status = NOT_STARTED

I added it and it seems to work now! Thank you so much for your help!