-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
43 lines (41 loc) · 1012 Bytes
/
index.html
File metadata and controls
43 lines (41 loc) · 1012 Bytes
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
input {
width: 20%;
}
</style>
<script>
function startDictation() {
if (window.hasOwnProperty('webkitSpeechRecognition')) {
var recognition = new webkitSpeechRecognition();
recognition.continuous = false;
recognition.interimResults = false;
recognition.lang = "si-LK";
recognition.start();
recognition.onresult = function (e) {
document.getElementById('transcript').value = e.results[0][0].transcript;
recognition.stop();
};
recognition.onerror = function(e) {
recognition.stop();
}
}
}
</script>
</head>
<body>
<center>
<form id="KD" method="get" >
<div class="speech">
<br><br><br>
<input type="text" name="s" id="transcript"/>
<br><br><br>
<img onclick="startDictation()" src="mic.png" />
</div>
</form>
</center>
</body>
</html>