mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 19:20:55 +00:00
30 lines
745 B
HTML
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> |