Audio loop not working online

URL of experiment: Sign in · GitLab

Description of the problem:

In the local psychopy version, the experiment correctly loops through 72 short .wav files (start=0, duration is left blank). In the online version, only the first audio plays correctly, and on all subsequent loops there is only silence or a click (possibly the first ~100 ms of the .wav file).

The audio files are in a subfolder “stim”, and are pulled from a .xlsx column with the folder name already in the string (“stim/name.wav”).

I don’t understand why only one audio file would load correctly?

Any advice would be appreciated!

Hello,
Did you include all the audio files in the Additional Resources?

Hi Chen,

Yes I did! I also tried to move them out of the subfolder and loaded them in again as the Additional Resources, but no change.

I printed the sound file to the console and it is selecting the correct sound, just cutting it off early??

Hey,
Your experiment is private. Do you mind making it public?

Ah I couldn’t figure out how to change it to public :(((

But update: here is a workaround: If I put inline code in the same routine as the sound object, and on “Begin Routine” set it to a tone and then back to the correct audio, then it works! If I just set it to fname (the filename) it doesn’t work, it has to be set to something else first and then back to fname ¯_(ツ)_/¯

stim1_2.setValue(440);
stim1_2.setValue(fname);

(this doesn’t work in python anymore though)

For online experiments at least, I’ve found that having the start time of the audio recordings not be 0.0 (e.g., give it a delay like 0.5) seems to prevent the issues where sounds after the first one in a loop don’t play correctly.

Hmm that definitely changes the program’s behavior, but now only the first couple loops play, and then the rest cut off after ~100 ms again.