Does the following looks correct? It doesn't work for me.
<!DOCTYPE html>
<html>
<head>
<script src="jspsych/jspsych.js"></script>
<script src="jspsych/plugins/jspsych-html-keyboard-response.js"></script>
<script src="jspsych/plugins/jspsych-audio-keyboard-response.js"></script>
<link href="jspsych/css/jspsych.css" rel="stylesheet">
</head>
<body></body>
<script>
var welcome_trial = {
type: 'html-keyboard-response',
stimulus: 'Welcome to my experiment.'
}
var audio_trial = {
type: 'audio-keyboard-response',
stimulus: function() { return 'jspsych/sound/Harvard_L04_S01_5.wav' },
choices: jsPsych.NO_KEYS,
trial_ends_after_audio: true
};
var audio = ['jspsych/sound/Harvard_L04_S01_5.wav'];
jsPsych.init({
timeline: [welcome_trial, image_button_trial, audio_trial],
preload_audio: audio,
on_finish: function(){
jsPsych.data.displayData();
}
})
</script>
</html>