forked from Picovoice/porcupine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
256 lines (238 loc) · 16.3 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
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Porcupine Demo</title>
</head>
<body>
<div align="center" style="padding: 2.5em">
<h1>
Porcupine Demo
</h1>
<div>
<img src="light_bulb_blue.svg" width="256em" id="light_bulb">
</div>
<div align="left" style="padding: 2em 0">
<p style="line-height: 2; font-size: 1.25em">
This demo allows you to change the color of the smart lamp (above) using Porcupine. Note that you need a
working microphone. This demo is running locally in the browser. You can turn off your internet connection
and it will keep working.
</p>
<p style="line-height: 2; font-size: 1.25em">
The wake phrase is <strong>Hey Edison</strong>. After the wake phrase is detected the lamp turns red and
starts listening to follow-on color name. Available colors are
<span style="background-color: #FF69B4;padding: 0.25em; border-radius: 5px">Hot Pink</span> ,
<span style="background-color: #FF1493;padding: 0.25em; border-radius: 5px">Deep Pink</span> ,
<span style="background-color: #B22222;padding: 0.25em; border-radius: 5px">Fire Brick</span> ,
<span style="background-color: #FFEFD5;padding: 0.25em; border-radius: 5px">Papaya Whip</span> ,
<span style="background-color: #FFDAB9;padding: 0.25em; border-radius: 5px">Peach Puff</span> ,
<span style="background-color: #F4A460;padding: 0.25em; border-radius: 5px">Sandy Brown</span> ,
<span style="background-color: #32CD32;padding: 0.25em; border-radius: 5px">Lime Green</span> ,
<span style="background-color: #228B22;padding: 0.25em; border-radius: 5px">Forest Green</span> ,
<span style="background-color: #00BFFF;padding: 0.25em; border-radius: 5px">Deep Sky Blue</span> ,
<span style="background-color: #FF00FF;padding: 0.25em; border-radius: 5px">Magenta</span> ,
<span style="background-color: #F5F5F5;padding: 0.25em; border-radius: 5px">White Smoke</span> ,
<span style="background-color: #FFF0F5;padding: 0.25em; border-radius: 5px">Lavender Blush</span> ,
and <span style="background-color: #696969;padding: 0.25em; border-radius: 5px">Dim Gray</span> .
</p>
<p align="center" >
<button onclick="start()" id="demo_button" style="font-size: 1.5em; padding: 0.5em 1em">
Start Demo
</button>
</p>
</div>
</div>
<script src="/node_modules/@picovoice/web-voice-processor/src/web_voice_processor.js"></script>
<script src="/node_modules/@picovoice/porcupine_manager/src/porcupine_manager.js"></script>
<script>
const KEYWORDS_ID = {
"Hey Edison": new Uint8Array([
0x69, 0x45, 0x8f, 0xdf, 0xc8, 0x5a, 0xec, 0xb2, 0x35, 0xba, 0x70, 0x01, 0xe6, 0xef, 0xd3, 0x5f, 0x80, 0x31,
0xb1, 0x90, 0x36, 0xd5, 0x3a, 0xcd, 0x5e, 0x24, 0xac, 0xf3, 0xea, 0x54, 0x44, 0x66, 0x22, 0xe1, 0xb7, 0xb8,
0x14, 0xfc, 0xa3, 0xd4, 0x1d, 0x73, 0x4a, 0x66, 0xb0, 0xaa, 0xf4, 0x84, 0xe2, 0x4d, 0x83, 0x4b, 0x5d, 0xd1,
0xba, 0x0c, 0x20, 0xa1, 0x96, 0x27, 0x3b, 0x6a, 0x9c, 0x53, 0x12, 0x49, 0xc2, 0x20, 0xf3, 0x4e, 0xad, 0x8d,
0x49, 0x03, 0x17, 0xbc, 0x27, 0x53, 0xed, 0xad, 0x29, 0xff, 0x68, 0xeb, 0xb6, 0x0b, 0x93, 0x46, 0xd2, 0x12,
0xcf, 0x20
]),
"Hot Pink": new Uint8Array([
0xe0, 0xc4, 0x33, 0x54, 0xd4, 0xc0, 0x4d, 0x63, 0x95, 0xaa, 0xfd, 0x57, 0x1e, 0xe4, 0x61, 0x19, 0x20, 0x35,
0x08, 0x8c, 0x97, 0x10, 0x24, 0xb8, 0x6b, 0xc1, 0xfb, 0x3f, 0xc1, 0x9b, 0x08, 0x84, 0x6d, 0xe0, 0xe2, 0xf5,
0xb5, 0xe5, 0xdd, 0xcf, 0x3c, 0xe2, 0xcb, 0x56, 0x99, 0xf8, 0x97, 0x30, 0xa4, 0xd9, 0x8c, 0xe6, 0xf4, 0x77,
0x42, 0x5e, 0x40, 0x27, 0x33, 0x7e, 0x59, 0x00, 0xe9, 0x83, 0x7d, 0x67, 0x64, 0x67, 0xf4, 0x14, 0xdc, 0x3c,
0x02, 0x8f, 0x4b, 0x26, 0xb9, 0xf6, 0xad, 0xb8, 0x5c, 0x13, 0x5b, 0x51, 0xcb, 0xea, 0x80, 0xbb
]),
"Deep Pink": new Uint8Array([
0x23, 0xe6, 0xd5, 0x8d, 0x26, 0x33, 0x16, 0x56, 0x9c, 0x8c, 0x7c, 0x27, 0x60, 0x21, 0x2c, 0x84, 0xd1, 0x25,
0xc3, 0x77, 0xa0, 0xa3, 0x70, 0xf4, 0xd0, 0xfc, 0x9d, 0x5b, 0xdf, 0x53, 0xef, 0xa9, 0x4e, 0xd8, 0x8d, 0xf4,
0xa9, 0xd8, 0x05, 0x9a, 0x66, 0xef, 0xc7, 0xc1, 0x7b, 0x7f, 0x1a, 0x32, 0x66, 0xe1, 0x5d, 0x70, 0xea, 0x19,
0x1a, 0x57, 0xf5, 0x67, 0x9d, 0xfc, 0xfe, 0x10, 0xb1, 0xc8, 0x39, 0xcc, 0x0f, 0x51, 0x5d, 0x53, 0x62, 0xe8,
0x57, 0xe0, 0xfc, 0xd9, 0xec, 0x89, 0x27, 0x75, 0xbf, 0x31, 0x49, 0xc6, 0xbb, 0x33, 0xcb, 0x36
]),
"Fire Brick": new Uint8Array([
0x07, 0x1f, 0x97, 0xb9, 0xc1, 0xc6, 0x7b, 0x24, 0x27, 0x14, 0xba, 0xf0, 0x36, 0x4f, 0x2e, 0x0e, 0x78, 0xfb,
0xc9, 0xc5, 0xa5, 0xec, 0xc1, 0x64, 0x25, 0x49, 0xc4, 0x23, 0xfb, 0xbc, 0xdc, 0x7f, 0xbf, 0x0c, 0x13, 0x17,
0xa9, 0x33, 0xef, 0x01, 0x2c, 0x1f, 0x33, 0x3c, 0x53, 0xc3, 0x69, 0xef, 0xd8, 0xd0, 0x0e, 0x23, 0x40, 0xaa,
0x56, 0x0b, 0x9a, 0x7f, 0xb7, 0x4a, 0xaf, 0x8c, 0xba, 0xd4, 0x3b, 0xb1, 0x7c, 0xb2, 0xa4, 0xa3, 0x59, 0xec,
0xd3, 0x79, 0x8f, 0x44, 0x40, 0x26, 0xbc, 0xe1, 0xd9, 0xb3, 0x5f, 0xcd, 0xcc, 0x9a, 0xf9, 0x21
]),
"Papaya Whip": new Uint8Array([
0xd9, 0x22, 0x45, 0x08, 0x78, 0x91, 0xa3, 0xee, 0x21, 0x76, 0xec, 0xe6, 0xf5, 0x15, 0xf3, 0x3c, 0x36, 0xbf,
0x01, 0xab, 0x6e, 0xbb, 0xb0, 0x12, 0xc0, 0xa9, 0x70, 0x71, 0xb1, 0xe1, 0xdf, 0xfc, 0x61, 0x28, 0x90, 0xe3,
0x3d, 0x66, 0x2f, 0xaf, 0xc9, 0x07, 0x8a, 0xe8, 0xde, 0xa1, 0x2a, 0xfa, 0xbd, 0xe8, 0xe6, 0x73, 0xe0, 0x26,
0x33, 0xbe, 0x97, 0xb0, 0xdf, 0x94, 0x7a, 0x9d, 0x60, 0x11, 0x16, 0xfd, 0x8f, 0x98, 0x85, 0xf6, 0x93, 0x61,
0xf8, 0x77, 0xb9, 0xaa, 0x61, 0x62, 0x8e, 0xf5, 0x81, 0xad, 0x7e, 0x4b, 0x94, 0xaa, 0x2a, 0xc9, 0x70, 0x97,
0x2b, 0xf7, 0xf6, 0x10, 0xdc, 0xdb, 0xd2, 0x18, 0xf5, 0x41
]),
"Peach Puff": new Uint8Array([
0xe1, 0x9d, 0x85, 0xc7, 0xe9, 0x28, 0xea, 0x32, 0xc0, 0x9d, 0x6b, 0xf4, 0xb3, 0xca, 0xb5, 0xab, 0x68, 0x9d,
0xf0, 0xfb, 0xa7, 0x42, 0xae, 0xc5, 0xb5, 0x9b, 0x76, 0x67, 0xa7, 0xcd, 0xd4, 0x7d, 0xa7, 0xd8, 0x04, 0x49,
0xac, 0x82, 0x78, 0xb8, 0xc9, 0x90, 0xda, 0x61, 0xdf, 0x61, 0x2c, 0x04, 0x34, 0x45, 0xc2, 0x3b, 0x72, 0x0d,
0x64, 0x03, 0x31, 0x3c, 0x8b, 0x8c, 0xbe, 0x16, 0x4d, 0xed, 0xe5, 0x9a, 0x04, 0xb2, 0x42, 0x2f, 0x98, 0x98,
0x77, 0x03, 0xc5, 0xc4, 0x2e, 0x43, 0x66, 0xe1, 0x9c, 0x89, 0x19, 0x11
]),
"Sandy Brown": new Uint8Array([
0x0a, 0xfe, 0x47, 0xd9, 0x28, 0xba, 0x24, 0xd8, 0xa7, 0x87, 0x22, 0xd2, 0xbc, 0x76, 0xb1, 0x97, 0xee, 0xf7,
0x0c, 0x03, 0xfe, 0x5c, 0x0e, 0x08, 0x5c, 0xf4, 0xcd, 0x94, 0x81, 0x3b, 0xe0, 0x6f, 0x34, 0x90, 0x0f, 0x83,
0x6f, 0xc4, 0x72, 0xc1, 0xda, 0x73, 0xa4, 0x67, 0x64, 0xff, 0x49, 0x63, 0x47, 0x24, 0xed, 0xbf, 0x3f, 0xac,
0x08, 0x7c, 0x24, 0x23, 0xe0, 0xb1, 0xb4, 0x31, 0x54, 0xef, 0xea, 0x0f, 0xe3, 0x3d, 0xc3, 0x47, 0x51, 0x3f,
0x47, 0x66, 0xc3, 0x80, 0xc2, 0xdf, 0x88, 0xf4, 0x46, 0x93, 0x29, 0x02, 0x43, 0xef, 0x85, 0x89, 0x77, 0x4e,
0xe1, 0xa9, 0xe6, 0x7e, 0xe5, 0xbe, 0x21, 0x41, 0xda, 0xee
]),
"Lime Green": new Uint8Array([
0x0e, 0xca, 0x4e, 0x76, 0x6c, 0x10, 0x12, 0x62, 0x51, 0x2b, 0x15, 0x2c, 0xeb, 0xce, 0xfe, 0xf1, 0xb7, 0xf4,
0x6b, 0x21, 0xdb, 0xf9, 0x24, 0x77, 0xfe, 0x87, 0x0f, 0xfe, 0x7c, 0xb9, 0xf3, 0x57, 0xc9, 0xd6, 0x0c, 0x73,
0x31, 0xd4, 0x61, 0xe5, 0xd5, 0x2a, 0x0d, 0xc5, 0x32, 0x75, 0x5d, 0x36, 0x33, 0x34, 0xda, 0x50, 0x0c, 0xd4,
0x4c, 0x2c, 0x94, 0x69, 0x8a, 0xaa, 0x9f, 0x7a, 0x10, 0x5f, 0x84, 0x51, 0x2c, 0xde, 0x24, 0x2c, 0x04, 0x22,
0x1e, 0x4f, 0x8c, 0xa9, 0xea, 0x92, 0x76, 0x84, 0xa8, 0xa1, 0xe5, 0x02, 0x3c, 0x97, 0x76, 0x48
]),
"Forest Green": new Uint8Array([
0xde, 0x62, 0xd6, 0xe8, 0xf4, 0x8a, 0x8a, 0xde, 0x40, 0x15, 0xd4, 0x41, 0xe6, 0xee, 0xe8, 0x86, 0x99, 0xef,
0x08, 0xc6, 0xb7, 0x5b, 0xa8, 0x3c, 0xdf, 0xd8, 0x14, 0x34, 0x82, 0x1e, 0xed, 0xe9, 0x6a, 0x00, 0xc2, 0x2b,
0x5e, 0x77, 0xdb, 0x31, 0x30, 0xfe, 0x65, 0x2c, 0xed, 0x6f, 0xbc, 0x0e, 0xbd, 0xd9, 0x6a, 0xcd, 0xe1, 0x53,
0x89, 0x13, 0x3c, 0xfa, 0x7b, 0x8f, 0x23, 0x7e, 0xf0, 0x26, 0x57, 0x4b, 0x16, 0x8f, 0xd8, 0x95, 0xc0, 0x55,
0x0f, 0x81, 0x21, 0x23, 0xa7, 0x21, 0x22, 0xe3, 0x3d, 0x12, 0xad, 0x77, 0xe6, 0xca, 0xda, 0xc5, 0x14, 0x0b,
0xf9, 0xcc, 0x91, 0xd2, 0xa4, 0xbc, 0x3c, 0xae, 0x62, 0xfe, 0x85, 0x37, 0x92, 0xa4
]),
"Deep Sky Blue": new Uint8Array([
0xd1, 0x23, 0x78, 0x10, 0x91, 0x2d, 0x65, 0x7d, 0x36, 0x03, 0xbc, 0x91, 0x57, 0x6b, 0xa8, 0x0e, 0x67, 0xb6,
0xa9, 0xb0, 0x24, 0xe3, 0x3e, 0x7e, 0x1c, 0x70, 0x1e, 0xd1, 0x71, 0x78, 0xe1, 0xc2, 0x3d, 0xeb, 0xdf, 0xc8,
0x6e, 0x4a, 0x58, 0xfe, 0x09, 0x95, 0xff, 0xce, 0x8f, 0x27, 0xbf, 0x24, 0x2d, 0xe7, 0x68, 0xbf, 0x69, 0xb8,
0xa1, 0x03, 0x05, 0x08, 0x6e, 0xbd, 0xbe, 0xa5, 0xca, 0xa6, 0x14, 0x4d, 0xb1, 0x61, 0x58, 0xcf, 0xf9, 0xb6,
0xe3, 0xc8, 0x93, 0xd2, 0x1a, 0xb3, 0x2d, 0x06, 0xf7, 0x67, 0x5e, 0x5c, 0xd9, 0x40, 0x81, 0x58, 0x0d, 0xff,
0x29, 0x64, 0x01, 0xa9, 0xa7, 0xc3, 0x99, 0x55, 0xc8, 0x1d
]),
"Magenta": new Uint8Array([
0x2f, 0x86, 0x64, 0x12, 0x2f, 0xd9, 0x8b, 0x33, 0x46, 0x63, 0x7a, 0xd0, 0xa4, 0x44, 0x5b, 0x7e, 0xc8, 0x1e,
0x3e, 0x97, 0x49, 0xde, 0xd4, 0x84, 0x40, 0xab, 0x8b, 0x09, 0xf0, 0x05, 0xd4, 0xc9, 0xc5, 0xcf, 0x63, 0x69,
0x74, 0x65, 0x6e, 0x6d, 0x2a, 0xa2, 0xa1, 0x64, 0x27, 0x8b, 0x61, 0x13, 0xf7, 0x74, 0x6a, 0xf1, 0xad, 0x4a,
0xe9, 0xa8, 0x2f, 0x05, 0xb0, 0x33, 0x77, 0xd3, 0x8e, 0x6a, 0x80, 0x6c, 0x12, 0xa0, 0x5f, 0xb7, 0x54, 0xcd,
0x1b, 0x72, 0xb7, 0x1c, 0xad, 0x8d, 0x18, 0xe6, 0xf9, 0x0b, 0x29, 0xbc, 0xa9, 0x0e, 0xb8, 0x99
]),
"White Smoke": new Uint8Array([
0x0a, 0xd0, 0xfb, 0x2f, 0x71, 0x26, 0x3d, 0xba, 0x75, 0x81, 0xd4, 0x80, 0x65, 0x04, 0xfc, 0xfb, 0x55, 0xb4,
0x54, 0x16, 0x96, 0x38, 0xee, 0x4a, 0x99, 0x39, 0x6a, 0x65, 0xab, 0x83, 0x58, 0x7e, 0xcd, 0xa2, 0x73, 0x24,
0x5a, 0x27, 0x33, 0x8c, 0x25, 0x8d, 0x10, 0x74, 0xb2, 0xf7, 0xd7, 0xe6, 0xd3, 0xeb, 0x86, 0xe6, 0xbb, 0xb5,
0x60, 0xf3, 0x79, 0xc2, 0x3d, 0x14, 0x17, 0x6f, 0x82, 0xad, 0xec, 0x49, 0x03, 0xb0, 0xad, 0xbf, 0x81, 0xd3,
0x2b, 0x44, 0xfe, 0xa6, 0x56, 0xfb, 0x90, 0x09, 0x73, 0xf5, 0x69, 0xbb, 0xec, 0x85, 0x9f, 0x77, 0x02, 0xba,
0xc3, 0x49, 0x46, 0xaf, 0x9c, 0xec
]),
"Lavender Blush": new Uint8Array([
0xe4, 0xc1, 0x25, 0x5e, 0x9a, 0x41, 0x5e, 0x06, 0xe5, 0xb1, 0x3e, 0x83, 0x90, 0x16, 0x9c, 0xf9, 0xeb, 0xc7,
0xce, 0xe9, 0xdb, 0xae, 0x81, 0x74, 0x9e, 0x50, 0x9a, 0xe8, 0x60, 0x52, 0xeb, 0x95, 0x33, 0x7d, 0x78, 0x30,
0x6f, 0xee, 0x4e, 0x99, 0x44, 0x0c, 0x92, 0x41, 0xc6, 0x33, 0xae, 0x31, 0x2e, 0x73, 0x6a, 0xc6, 0xbf, 0x4e,
0xd2, 0x17, 0xbe, 0x81, 0x4d, 0xc8, 0xe6, 0x25, 0xe2, 0xe5, 0x18, 0x94, 0x78, 0x31, 0x4e, 0x00, 0x00, 0x69,
0x68, 0xa5, 0x30, 0x38, 0x34, 0x16, 0x60, 0xb5, 0xef, 0xaa, 0xe8, 0x3e, 0x9d, 0xc4, 0xdb, 0x95, 0xe5, 0x31,
0x5a, 0x5c, 0x84, 0xad, 0xec, 0xa0, 0x97, 0xd5, 0xd0, 0x47, 0x03, 0x49, 0xae, 0x88, 0x56, 0xb9, 0x59, 0x96
]),
"Dim Gray": new Uint8Array([
0x32, 0x1c, 0xff, 0x0e, 0xbc, 0xd4, 0x2d, 0x0e, 0xa1, 0x96, 0x35, 0x66, 0x68, 0x86, 0xa5, 0xfe, 0xcf, 0x62,
0x68, 0xde, 0x24, 0x9e, 0xa5, 0x9c, 0x36, 0xae, 0xa9, 0xc7, 0x14, 0xfc, 0x1e, 0x50, 0x8c, 0x0a, 0x2e, 0xee,
0x5d, 0x60, 0x3d, 0xdb, 0x8a, 0xe1, 0xe9, 0xcd, 0xf6, 0xa0, 0x55, 0xaf, 0x01, 0xb8, 0x15, 0x5d, 0x46, 0xc0,
0x42, 0xae, 0x0e, 0x84, 0x13, 0xab, 0x6e, 0xfe, 0x17, 0x38, 0xd4, 0xce, 0xe1, 0x07, 0xa8, 0x88, 0x32, 0xd9,
0x66, 0x4e, 0xd5, 0x31, 0x02, 0xcf, 0xfe, 0x3c, 0x27, 0x1d, 0x40, 0x71
])
};
const COLORS_CODE = {
"Hot Pink": "#FF69B4",
"Deep Pink": "#FF1493",
"Fire Brick": "#B22222",
"Papaya Whip": "#FFEFD5",
"Peach Puff": "#FFDAB9",
"Sandy Brown": "#F4A460",
"Lime Green": "#32CD32",
"Forest Green": "#228B22",
"Deep Sky Blue": "#191970",
"Magenta": "#FF00FF",
"White Smoke": "#F5F5F5",
"Lavender Blush": "#FFF0F5",
"Dim Gray": "#696969"
};
const SENSITIVITIES = new Float32Array([
0.5, // "Hey Edison"
0.5, // "Hot Pink"
0.5, // "Deep Pink"
0.5, // "Fire Brick"
0.5, // "Papaya Whip"
0.5, // "Peach Puff"
0.5, // "Sandy Brown"
0.5, // "Lime Green"
0.5, // "Forest Green"
0.5, // "Midnight Blue"
0.5, // "Magenta"
0.5, // "White Smoke"
0.5, // "Lavender Blush"
0.5 // "Dim Gray"
]);
let currentTimeSeconds = function () {
return new Date().getTime() / 1000;
};
let is_listening = false;
let listeningStartSeconds;
let processCallback = function (keyword) {
if (keyword === null) {
if (is_listening && (currentTimeSeconds() - listeningStartSeconds) > 5) {
document.querySelector("#light_bulb").setAttribute("src", "light_bulb_blue.svg");
is_listening = false;
}
return;
}
if (is_listening) {
if (keyword in COLORS_CODE) {
let backgroundColor = "background-color:" + COLORS_CODE[keyword];
document.querySelector("#light_bulb").setAttribute("style", backgroundColor);
}
document.querySelector("#light_bulb").setAttribute("src", "light_bulb_blue.svg");
is_listening = false;
}
if (keyword === "Hey Edison") {
document.querySelector("#light_bulb").setAttribute("src", "light_bulb_red.svg");
is_listening = true;
listeningStartSeconds = currentTimeSeconds();
}
};
let porcupineManager;
let audioManagerErrorCallback = function (ex) {
alert(ex.toString());
document.querySelector("#light_bulb").setAttribute("style", "background-color:white");
document.querySelector("#light_bulb").setAttribute("src", "light_bulb_blue.svg");
document.querySelector("#demo_button").setAttribute("onclick", "start()");
document.querySelector("#demo_button").innerText = "Start Demo";
};
start = function () {
porcupineManager = PorcupineManager(
"/node_modules/@picovoice/porcupine_manager/src/porcupine_worker.js",
"/node_modules/@picovoice/web-voice-processor/src/downsampling_worker.js");
porcupineManager.start(KEYWORDS_ID, SENSITIVITIES, processCallback, audioManagerErrorCallback);
document.querySelector("#demo_button").setAttribute("onclick", "stop()");
document.querySelector("#demo_button").innerText = "Stop Demo";
};
stop = function () {
porcupineManager.stop();
document.querySelector("#light_bulb").setAttribute("style", "background-color:white");
document.querySelector("#light_bulb").setAttribute("src", "light_bulb_blue.svg");
document.querySelector("#demo_button").setAttribute("onclick", "start()");
document.querySelector("#demo_button").innerText = "Start Demo";
};
</script>
</body>
</html>