If this template helps then use it. If not then just delete and start from scratch.
OS (e.g. Win10): MacOS 26.0.1 (25A362)
PsychoPy version (e.g. 2024.2.4 Py 3.8): 2025.1.1
Standard Standalone Installation? (y/n) If not then what?: y
URL of experiment: Pavlovia
Do you want it to also run locally? (y/n) n
What are you trying to achieve?: I have several sounds that I want to play in a loop. The filenames are in a csv file. It works, but sounds are just randomly not played.
What did you try to make it work?: I tried it in the builder, I set the starting time to 0.1, I split the loop in half, I put it outside of the builder (meaning I left the object in there, but added a condition that was not met and played it in the coder by putting OBJECTNAME.play()).
There is no error message, it simply doesn’t play. And there is no system which makes me nervous. It seems sounds are somehow tricky, but I don’t understand why. I need it to work until next week and I am thinking of making the sounds into movies just so that it might work better. But I am unsure if this would even solve the issue. Any help is highly appreciated! Thanks in advance!
If the sounds aren’t playing at random, try changing your loop to sequential to see if the issue is with specific trials.
I did that, it’s still random and the weird thing is that the sound that doesn’t like being played the most is one that is the same in every loop.
I do have a specific answering scheme within the loop such as some sound are just played if button A is clicked and some sounds only if button B is clicked. I am realizing that via the function “continueRountine = False”. But I don’t see how this could be an issue. And as I said there is no logic behind it. It just stops playing in the middle of the loop, sometimes at the beginning etc. And since I have several of those loops it also sometimes stops in loop 1, sometimes in loop 2 etc. It even sometimes suddenly re-appears.
The sounds seem to not work as soon as I mix up the responses. I have the following routines in my loop:
A B C D E D
A always plays. Then, participants press either button 1 or 2. If they press button 1, routine B is played and the rest is skipped. If they press button 2, routine B is skipped and the rest is played.
This is repeated 6 times, different sounds are played in the different routines and they are given via in csv file in the loop.
As soon as press button 1 in the one run of the loop and button 2 in another run (or vice versa) this seems to mess with the sounds.
I added a sound.stop() in the if clause skipping the routines in case a sound is started and that this messes anything up. Doesn’t help.
I also split the loop in three separate loops (because the first two runs always worked regardless of which button was pressed and the problems started later) but the sound is still missing in the second loop.
I am freaking out a bit now… Is there any other way to implement this? Without a loop? Or maybe without skipping routines?