-
Notifications
You must be signed in to change notification settings - Fork 0
/
soundtest.js
39 lines (35 loc) · 1.01 KB
/
soundtest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//////////////
// soundtest
////////////
const AUDIO_PATH = './sounds/'; //currently not used!
const AUDIO_CHECK_PROMPT_TEXT_LOOP = `
You can play the test sound again
(and adjust the audio level for your headpones).
If you're comfortable, click 'continue'...
`
// audio test procedure
let test_audio_looped = {
post_trial_gap: DEFAULT_ITI,
timeline:
[
{
type: jsPsychAudioButtonResponse,
stimulus: './sounds/beep.mp3',
choices: ['Play Again', 'Continue'],
prompt: function(){
return "<div class='instruction' >" +
'<p>' + AUDIO_CHECK_PROMPT_TEXT_LOOP + '</p></div>'
}
}
],
loop_function: function(data){
if (data.trials[0].response == 0){
return true; // loop again!
} else {
return false; // continue
}
},
on_finish: function(data) {
data.audio_checked = true;
}
};