jsPsych/examples/jspsych-initialize-microphone.html
2021-11-23 14:51:55 -05:00

30 lines
745 B
HTML

<!DOCTYPE html>
<html>
<head>
<script src="../packages/jspsych/dist/index.browser.js"></script>
<script src="../packages/plugin-initialize-microphone/dist/index.browser.js"></script>
<script src="../packages/plugin-html-audio-response/dist/index.browser.js"></script>
<link rel="stylesheet" href="../packages/jspsych/css/jspsych.css">
</head>
<body></body>
<script>
var jsPsych = initJsPsych();
let init_mic = {
type: jsPsychInitializeMicrophone,
}
let ar = {
type: jsPsychHtmlAudioResponse,
stimulus: '<div style="width:400px; height: 400px; background-color: red;"></div>',
allow_playback: true,
on_finish: (data) => {
console.log(data);
}
}
jsPsych.run([init_mic, ar]);
</script>
</html>