Hi Benedek,
In
this study, in the file
induce.js, we programmed a procedure based on the pairing task from
Moran & Bar-Anan (2013). That procedure plays sound. The procedure also includes catch trials with a secondary task of choosing the correct word, used to make sure that participants listen to sounds. I recommend running the study to understand what's going on in theat procedure (the study starts with the induction).
The most relevant code is in lines 44-77. The line that gets the relevant sound file is "var src = _.get(currentTrial, 'stimuli[2].$templated.media.soundd');". It is based on the knowledge that the second stimulus in the trials used in our task is the one that holds the mp3 file. This part might be slightly different in your trial, depending on the stimuli in that trial. Anyway, feel free to send another question because adapting the code for your task might not be straightforward.
Yoav