Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added examples/.DS_Store
Binary file not shown.
62 changes: 35 additions & 27 deletions examples/index.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<title>jsPsychPluginVoiceResponse Example</title>
<script src="https://unpkg.com/jspsych"></script>
<!-- Load the published plugin packages here -->
<script src="https://unpkg.com/@jspsych/plugin-initialize-microphone@2.1.0"></script>
<script src="https://unpkg.com/@jspsych/plugin-html-button-response@2.1.0"></script>
<!-- Load the local voice response plugin file -->
<script src="../dist/index.browser.js"></script>
<link rel="stylesheet" href="https://unpkg.com/jspsych/css/jspsych.css" />
</head>

<head>
<title>jsPsychPluginVoiceResponse Example</title>
<script src="https://unpkg.com/jspsych"></script>
<script src="https://unpkg.com/@jspsych/plugin-initialize-microphone@2.1.0"></script>
<script src="../dist/index.browser.js"></script>
<link rel="stylesheet" href="https://unpkg.com/jspsych/css/jspsych.css">
</head>
<body></body>
<script>
const jsPsych = initJsPsych({
on_finish: function () {
jsPsych.data.displayData();
},
});

<body></body>
<script>
const jsPsych = initJsPsych({
on_finish: function () {
jsPsych.data.displayData();
}
});
const init_mic = {
type: jsPsychInitializeMicrophone,
};

const init_mic = {
type: jsPsychInitializeMicrophone
};
const start = {
type: jsPsychHtmlButtonResponse,
stimulus: "Recording will begin when you press start.",
choices: ["Start"]
};

const trial = {
type: jsPsychPluginVoiceResponse,
stimulus: "Say something!",
allow_playback: true,
local_download: true,
};
const trial = {
type: jsPsychPluginVoiceResponse,
stimulus: "Say something!",
allow_playback: true,
save_audio_url: false,
// local_download: true,
};

jsPsych.run([init_mic, trial]);
</script>

</html>
jsPsych.run([init_mic, start, trial]);
</script>
</html>
Loading