-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcalibration.html
More file actions
69 lines (59 loc) · 2.06 KB
/
calibration.html
File metadata and controls
69 lines (59 loc) · 2.06 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html>
<head>
<script src="jspsych-6.0.4/jspsych.js"></script>
<script src="utils/audio.js"></script>
<script src="javascript/jquery-3.1.1.min.js"></script>
<script src="/assets/javascripts/jatos.js"></script>
<link rel="stylesheet" href="bootstrap-3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" media="all" href="static/css/forms.css" >
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class=TitleBox id=title></div>
<div class=FormBox >
<div id=description></div>
<button id=play1>Play 1</button>
<button id=play2>Play 2</button>
<button id=play3>Play 3</button>
<button id=continue>Continue</button>
</div>
</body>
<script>
/* create timeline */
var timeline = [];
var test_sounds = ['static/audio/0.mp3', 'static/audio/1.mp3','static/audio/2.mp3'];
var lang = "default";
if (jatos.studySessionData.language){
lang = jatos.studySessionData.language;
}
jatos.onLoad(function () {
$.ajax({
url:"static/html/calibration.html",
type:'GET',
success: function(data) {
var description;
$('#title').html( $('<div>').append(data).find(`#${lang}`).find('#title'));
$('#description').html( $('<div>').append(data).find(`#${lang}`).find('#text'));
}
});
var context = jsPsych.pluginAPI.audioContext();
let player = new SamplePlayer(context, jatos.studySessionData["calibration_samples"]);
$("#play1").click(function(){
player.playSound(0)
});
$("#play2").click(function(){
player.playSound(1)
});
$("#play3").click(function(){
player.playSound(2)
});
debugger;
$("#continue").click(function(){
player.unbind()
jatos.startNextComponent();
});
});
</script>
</body>