jsPsych/tests&examples/jspsych-single-audio.html
Josh de Leeuw d6ba7c9a26 fixes #222
2016-01-23 22:35:45 -05:00

36 lines
824 B
HTML

<!doctype html>
<html>
<head>
<script src="js/jquery.min.js"></script>
<script src="../jspsych.js"></script>
<script src="../plugins/jspsych-single-audio.js"></script>
<link rel="stylesheet" href="../css/jspsych.css"></link>
</head>
<body>
<div id="jspsych-target"></div>
</body>
<script>
/*
this demo will only work if run online or with special permissions enable offline
for chrome, launch the browser from the command-line:
chrome --allow-file-access-from-files
*/
var block_1 = {
type: 'single-audio',
timeline: [
{stimulus: 'sound/sound.mp3'},
{stimulus: 'sound/hammer.mp3'}
]
}
jsPsych.init({
display_element: $('#jspsych-target'),
timeline: [block_1],
on_finish: function() {jsPsych.data.displayData();}
});
</script>
</html>