PsychoPy version: 2025.2.3
Standard Standalone Installation? Y
Do you want it to also run locally? N
What are you trying to achieve?: My experiment loops through a conditions file and pulls a separate audio file (.wav) to play during each iteration of a routine. However, I am encountering an issue with the audio files when running the experiment online through Pavlovia. At a seemingly random point, the audio files stop playing, replaced only with a dull “click.” Sometimes, the experiment runs fine and this issue doesn’t appear at all.
It seems like the experiment is still continuing to loop through the conditions file, but the audio files simply stop playing. This is similar to the issue described here: https://discourse.psychopy.org/t/some-audio-files-dont-play-on-pavlovia-instead-play-a-click-sound/46103. This issue was not present when I ran a similar experiment in PsychoPy version 2023.2.3, but I am now having difficulty getting the experiment working in an older version of PsychoPy again. So I would like to get this fixed in the newer PsychoPy version that I’m using (2025.2.3).
What did you try to make it work?: I have tried adding a delay to the beginning of the routine so the audio file plays after a 0.1s delay. This has not fixed the issue.
Any suggestions would be much appreciated. What’s made troubleshooting difficult is just how inconsistent this bug is. As I mentioned, I don’t encounter this bug every time the experiment is run, and when it does come up, it’s at variable points in the experiment. The bug doesn’t seem to be particular to a certain browser either (I’ve encountered it in both Chrome and Explorer, for example).
Thanks! And happy to provide more information if it’s helpful.
Hey Calvin,
Can you explain what you mean by “I am now having difficulty getting the experiment working in an older version of PsychoPy again”. You will need to recreate the experiment in the newest version of psychopy to be able to run online experiments.
Do you have variable stop durations? As in, are the audio files all the same length? If not that will cause issues.
And refer to the crib sheet for how to fix possible issues with .wav ( PsychoPy Python to Javascript crib sheet 2023 - Google Docs ).
Try running through your experiment sequential, rather than random and see if it is a certain audio file that causes it. You state that it is variable in WHEN it occurs, but not any description as to if it’s linked to a specific audio file.
Issac
Hi Isaac,
Thank you so much for all your suggestions! I really appreciate it.
Can you explain what you mean by “I am now having difficulty getting the experiment working in an older version of PsychoPy again”. You will need to recreate the experiment in the newest version of psychopy to be able to run online experiments.
I had a nearly identical experiment set up in PsychoPy v. 2023.2.3 that never had this issue. It was only when I set the same experiment up in v. 2025.2.3 that I began encountering this audio issue, so I thought I would try to get an older version of the experiment working again to see if that would fix it.
Do you have variable stop durations? As in, are the audio files all the same length? If not that will cause issues.
Yes, the audio files have variable stop durations. Unfortunately, the stimuli we use need to have variable stop durations. That has not caused issues for us before, only when using the most recent version of PsychoPy it seems.
And refer to the crib sheet for how to fix possible issues with .wav ( PsychoPy Python to Javascript crib sheet 2023 - Google Docs ).
.wav files have not given us this issue before, but would you recommend switching to .mpg files? Ideally, we would like the highest audio quality possible, but not if this bug persists.
Try running through your experiment sequential, rather than random and see if it is a certain audio file that causes it. You state that it is variable in WHEN it occurs, but not any description as to if it’s linked to a specific audio file.
The experiment is already sequential, and the issue does not seem to be linked to a specific audio file.
Dear Calvin,
Did you recreate the experiment from scratch? Or just imported it to 2025.2.3 (with some modifications).
For the durations, set the duration to be the longest of your audio files.Or is the the difference in variation in too long and would cause issues with the experimental task.
Is the occurrence of the problem tied to when a participant responds? The best way would be to set the overall trial/audio duration to be a non-variable time (longer than the longest audio file length), then let the experiment “auto-play” through trials to completion. based on the outcomes of that, you have a better idea of where the issue occurs.
Audio quality, from what I know at a very baseline understanding, has to deal sampling rates, with various audio file types dealing with compression and different aspects of audio data (super basic understanding and I am most likely overgeneralizing the differences and nuances).
Issac
Thanks for the additional comments!
When I set the experiment up in 2025.2.3, I imported the 2023.2.3 experiment and made modifications as necessary to get it working. I did not recreate it from scratch.
As for audio file duration, yes, the difference in duration between audio files is too long and would interfere with the task, unfortunately.
As far as I can tell, the problem is not related to when a participant responds. The participant’s task during this part of the experiment is a 1-back detection task, in which they click when they hear the same audio twice in a row. For details on how each trial works:
- Each trial consists of two routines:
- The first routine plays an audio files.
- The second routine runs only when the previous audio file was a repeated audio and participants must click to indicate that they detected the 1-back. This routine only ends after the participant clicks and a subsequent reward “ding” sound is played.
The audio issues have not coincided with these 1-back detection routines. However, I did just remove an extraneous mouse component from the first routine (that only plays the audio file) in each trial, in case the ability to register clicks during this routine somehow messed with things.
Just another quick update: disabling the mouse component so that the experiment doesn’t register clicks when participants aren’t supposed to be clicking as part of the 1-back detection task did not resolve the issue. The audio files still sometime stop working at a random point.