Hi, I have a PsychoPy Builder exp turned into a PsychoJS to run on Pavlovia (it runs runs locally as it should).
In the main trial routine(s) there are multiple image and two audio components (audio_1 and audio_2).
Audio_1: Start: 0.01 (so basically cc. when all the images appear), Stop - condition: $audio1._isFinished;
Audio_2 is played after audio_1 finishes.
The two sounds are set to variables (changing every repeat), such as audio2_path.
The exact content is defined in the prior, fixcross routine (e.g. audio2.setSound(audio2_path), essentially referring to a condition file. Both sounds are created earlier, in another routine e.g.
start_audio = “audios/bouger.mp3”
audio1 = new sound.Sound({
win: psychoJS.window,
value: start_audio
});
main_audio = “audios/silence.mp3”;
audio2 = new sound.Sound({
win: psychoJS.window,
value:main_audio
});
The main issue is that the sounds are not played in the online version. Audio1 is not played at all, Audio2 may be played once in the third trial or so and that is it, I hear some clicking, so the silence.mp3 may be played from time to time.
The rources are loaded at the beginning.
I read a few threads here including the cribsheet and this: Asynchronous sound success story, where there is a potential solution for such problems.
However, I don’t see how I could adapt this solution to my case.
Beside having two sounds and not just one, I also have a prior rountine (fixcross routine) the duration of which is not fixed, as i nthe example by wakecarter. This prior rountine lasts max is 2 sec but participants have to click on a button presented in this rountine - to ensure a certain starting position of the mouse in the main_trial routine). So duration can be anything.
I would appreciate any help.