| Reference | Downloads | Github

Sound Files stall and don't play sequentially on Pavlovia

URL of experiment:

Description of the problem:

I’m recording spacebar tap timings from participants as they listen to sequential audio files that are read from a .csv file. Running the experiment locally (from the psychopy GUI via builder or coder), I had to add the following lines into a code component in order for the wav files to play one after another otherwise it would just stall and not continue on to the next sound at the end of the current sound.

if t >= sound.duration:
continueRoutine = False

I generated JS files for Pavlovia but when I run/pilot the experiment online, the sound stalls and is unable to continue on to the next sound. I verified that this code component was being translated into the generated javascript. In the js file, it seems like this code block should account for the end of the sound but it doesn’t seem to proceed to the next sound.

if (t >= (sound.getDuration() + sound.tStart) && sound.status === PsychoJS.Status.STARTED) {
sound.stop(); // stop the sound (if longer than duration)
sound.status = PsychoJS.Status.FINISHED;
console.log(“sound stimulus end”);


I added the console.log line to see that it does enter into this conditional however for some reason the next sound doesn’t play or isn’t being loaded - I’m not entirely sure.

NB: I’m using wav files but I’ve tried it with mp3s (which returns an ‘unknown format’ error) and aiff which returns some type of error referencing a ‘howl loop’ (?)).

Any help would be super appreciated! many thanks in advance :slight_smile: