Replies: 1 comment
-
One thing you could do is use the audio-keyboard-response plugin to play the audio, and add the image to the screen via the var start = {
type: 'html-button-response',
choices: ['Start'],
stimulus: '<p>The user needs to interact with the page before the audio will play.</p>'
};
var trial = {
type: 'audio-keyboard-response',
stimulus: 'jspsych-6.1.0/examples/sound/speech_blue.mp3',
choices: ['f','j'],
prompt: '<img src="jspsych-6.1.0/examples/img/1.gif">'
};
jsPsych.init({
timeline: [start, trial],
preload_images: ['jspsych-6.1.0/examples/img/1.gif'],
use_webaudio: false,
on_finish: function () {
jsPsych.data.displayData();
}
}); Note that if you do it this way, you need to manually preload the images in Does that do what you need? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I am trying to code a serial reaction time task where I present two stimuli (an image and audio) simultaneously while the participant reacts to the image. I know there is a plugin for audio-keyboard responses and one for image-keyboard but is there a way to combine the two? Or is there a way to integrate audio with the serial-reaction-time plugin?
Sorry, I am pretty new to this.
Beta Was this translation helpful? Give feedback.
All reactions