-
Notifications
You must be signed in to change notification settings - Fork 0
/
read6.html
174 lines (152 loc) · 4.36 KB
/
read6.html
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!DOCTYPE html>
<html><head>
<style>
select { font-size: 35px; width: 240px; padding-left: 25px }
option { text-align: center; text-indent: 10px; }
</style>
<script src="sen_arr.js"></script>
<script src="https://code.responsivevoice.org/responsivevoice.js"></script>
<!-- script src="speakClient.js"></script -->
<script language="javascript">
1;
var count=0;
var gl_count=0;
var myHelp = new Audio("./help.mp3");
responsiveVoice.setDefaultVoice("US English Male");
/*
var msg = new SpeechSynthesisUtterance();
var voices = window.speechSynthesis.getVoices();
speechSynthesis.getVoices().forEach(function(voice) {
console.log(voice.name, voice.default ? '(default)' :'');
});
msg.voice = voices[10]; // Note: some voices don't support altering params
msg.voiceURI = 'native';
msg.volume = 1; // 0 to 1
msg.rate = .2; // 0.1 to 10
msg.pitch = 1; //0 to 2
msg.lang = 'en-US';
*/
function onLoad() {
eButton();
/* myHelp.addEventListener('ended', function(e) {
eButton();
}, false);
*/
1;
getText();
// Welcome();
}
/*
function Welcome() {
myWelcome = new Audio("./welcome.mp3");
myWelcome.loop = true;
myWelcome.play();
}
*/
function help() {
1;
myHelp.addEventListener('ended', function(e) {
eButton();
}, false);
stopLoop();
// myHelp.play();
}
function dButton() {
1;
document.getElementById("book").disabled = true;
document.getElementById("bookimg").src = "bookd.jpg";
document.getElementById("ra").disabled = true;
document.getElementById("raimg").src = "rad.jpg";
document.getElementById("ua").disabled = true;
document.getElementById("uaimg").src = "uad.jpg";
document.getElementById("da").disabled = true;
document.getElementById("daimg").src = "dad.jpg";
}
function eButton() {
1;
document.getElementById("book").disabled = false;
document.getElementById("bookimg").src = "book.jpg";
document.getElementById("ra").disabled = false;
document.getElementById("raimg").src = "ra.jpg";
document.getElementById("ua").disabled = false;
document.getElementById("uaimg").src = "ua.jpg";
document.getElementById("da").disabled = false;
document.getElementById("daimg").src = "da.jpg";
}
function stopLoop() {
myWelcome.loop=false;
myWelcome.pause();
}
function getText() {
document.getElementById("text").innerHTML=sentence_arr[gl_count][count];
}
function both() {
getText();
getSound();
}
function increment () {
count++;
if (count >= (sentence_arr[gl_count].length)) {
count = 0;
}
getText();
}
function gl_increment () {
count=0;
gl_count++;
if (gl_count > 6) {
gl_count = 0;
}
getText();
}
function gl_decrement () {
count=0;
gl_count--;
if (gl_count < 0) {
gl_count = 0;
}
getText();
}
function getSound() {
// speak(sentence_arr[gl_count][count]);
// var msg = new SpeechSynthesisUtterance(sentence_arr[gl_count][count]);
var msg = (sentence_arr[gl_count][count]);
// window.speechSynthesis.speak(msg);
msg.text = sentence_arr[gl_count][count];
// speechSynthesis.speak(msg);
responsiveVoice.speak(msg, "US English Male", {rate: .2});
}
</script>
<meta charset="utf-8"><title>Reading Teacher</title>
</head>
<!-- body -->
<body onload="onLoad()">
<div id="audio"></div>
<br>
<br>
<br>
<br>
<div align="center">
<table style="width: 700px;">
<tbody>
<tr>
<td colspan="5" id="text" style="border: 5px solid black; font-size: 200%; font-family: Arial,Helvetica,sans-serif; vertical-align: middle; height: 100px; border-collapse: collapse; text-align: center;">
</td>
</tr>
<tr height="100">
<td style="text-align: center;"><button type="button" onclick="help()"><img src="gc.jpg" height="50"></button></td>
<td style="text-align: center;"><button id="book" type="button" onclick="getSound()"><img id="bookimg" src="book.jpg" height="50"></button></td>
<td style="text-align: center;"><button id="ra" type="button" onclick="increment()"><img id="raimg" src="ra.jpg" height="50"></button></td>
<td style="text-align: center;"><button id="ua" type="button" onclick="gl_increment()"><img id="uaimg" src="ua.jpg" height="50"></button></td>
<td style="text-align: center;"><button id="da" type="button" onclick="gl_decrement()"><img id="daimg" src="da.jpg" height="50"></button></td>
</tr>
<tr>
<td colspan="5" style="text-align: center;">
<br>
<br>
</td>
</tr>
</tbody>
</table>
</div>
</body></html>