-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
70 lines (57 loc) · 2.19 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Speech to Text Test</title>
<link rel="stylesheet" href="https://css.furret.codes/css/library.min.css" />
</head>
<body>
<div class="container">
<h1>Speech 2 Text</h1>
<p>
Testing Chrome's <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API">Web Speech API</a>
for a Speech Recognition project.
</p>
<blockquote cite="https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API">
<p>
Speech recognition involves receiving speech through a device's microphone,
which is then checked by a speech recognition service against a list of
grammar (basically, the vocabulary you want to have recognized in a particular
app.) When a word or phrase is successfully recognized, it is returned as a result
(or list of results) as a text string, and further actions can be initiated as a
result.
</p>
<footer>
<cite>MDN, "Using the Web Speech API"</cite>
</footer>
</blockquote>
<p>
The below two examples use the Web Speech API. It only works on Chrome and
Safari currently.
</p>
<h2>Example 1</h2>
<p>
This example will record audio and then transcribe what was spoken to text,
as well as present the accuracy of the transcription.
</p>
<p><button type="button" id="startExample1">Start</button> <span id="action1">Press the button to start!</span></p>
<form>
<label for="output1">Output</label>
<textarea id="output1" type="textarea" readonly rows="4"></textarea>
</form>
<h2>Example 2</h2>
<p>
This example uses a predefined list of correct values to choose a CSS color
and then set the <code>background-color</code> property of the input to the
spoken color.
</p>
<p><button type="button" id="startExample2">Start</button> <span id="action2">Dicatate a CSS color value!</span></p>
<form>
<label for="output2">Output</label>
<input id="output2" type="text" readonly></input>
</form>
</div>
<script src="script.js"></script>
</body>
</html>