-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
542 lines (511 loc) · 28.4 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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
<!DOCTYPE html>
<html style="height:100%;">
<head>
<title>FindIt</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="scripts/leaflet/leaflet.css">
<style>
.pulse {
display: block;
height: 130px;
width:130px;
border-radius: 50%;
background: #1f5846;
cursor: pointer;
box-shadow: 0 0 0 rgba(0,0, 0);
animation: pulse 1s infinite;
}
.pulse:hover {
transition: ease-in 0.3s;
background-color:#00000073;
}
@-webkit-keyframes pulse {
0% {
-webkit-box-shadow: 0 0 0 0 rgba(204,169,44, 0.4);
}
70% {
-webkit-box-shadow: 0 0 0 10px rgba(204,169,44, 0);
}
100% {
-webkit-box-shadow: 0 0 0 0 rgba(204,169,44, 0);
}
}
@keyframes pulse {
0% {
-moz-box-shadow: 0 0 0 0 rgba(204,169,44, 0.4);
box-shadow: 0 0 0 0 rgba(204,169,44, 0.4);
}
70% {
-moz-box-shadow: 0 0 0 10px rgba(204,169,44, 0);
box-shadow: 0 0 0 10px rgba(204,169,44, 0);
}
100% {
-moz-box-shadow: 0 0 0 0 rgba(204,169,44, 0);
box-shadow: 0 0 0 0 rgba(204,169,44, 0);
}
}
#start{
position:relative;
font-size:1em;
background:white;
padding:3px;
outline:none;
display:inline-block;
border-radius:9999em;
}
#end{
position:relative;
font-size:1em;
background:white;
padding:3px;
outline:none;
display:inline-block;
border-radius:9999em;
}
#search-text-input{
border-top:thin solid #e5e5e5;
border-right:thin solid #e5e5e5;
border-bottom:0;
border-left: thin solid #e5e5e5;
box-shadow:0px 1px 1px #e5e5e5;
float: left;
height:17px;
margin:.8em 0 0 .5em;
outline:0;
padding:.4em 0 .4em .6em;
width: 183px;
}
#button-holder{
background-color: #f1f1f1;
border-top:thin solid #e5e5e5;
box-shadow:1px 1px 1px 1px #e5e5e5;
cursor:pointer;
height:27px;
text-align:center;
width: 50px;
}
#clear1{
background-color: #f1f1f1;
border-top:thin solid #e5e5e5;
box-shadow:1px 1px 1px 1px #e5e5e5;
cursor:pointer;
height:27px;
width: 50px;
}
#button-holder img{
margin:4px;
width:20px;
}
</style>
</head>
<body style="height:100%;margin-top:0px;margin-bottom:0px;margin-left:0px;min-height:550px;min-width:1275px;">
<div id="side_bar_in" style="width:20%;height:100%;background:#1f5846;float:left;">
<div>
<div id="btn" onclick="say_search()" onmousedown="beep.play()" style="width: 130px; height: 130px;margin: 65px;border-radius: 100px;position:relative;top:30px;">
<img src="images/mic.png" class="pulse">
<div class="mess" style="border-radius:5px;width: 100px;height: 20px;background-color: #d0c6c6;display: none;position: relative;top: 10px;left: 15px;">
<span style="width: 30px;height: 20px;padding: 7px; line-height: 20px;font-family:helvetica;">speak now ..</span>
</div>
</div>
</div>
<br>
<form id="myForm" action="data.php" method="post" name="form" style="position: relative;left: 30px;" >
<input type="text" name="start" placeholder="select starting point" id="start" style="height:25px;" />
<br>
</br>
<input type="text" name="end" placeholder="select end point" id="end" style="height:25px;"/>
<br>
</br>
<button class="hovi" onclick="return chk()" id="button-holder" style="margin-left:48px;border: 2px solid gray;border-top-left-radius: 25px;border-bottom-left-radius: 25px;background:white;border:2px solid black;outline:none; height: 25px; width: 50px;border:none; position: relative;">
<img src="images/search.png" style="height:18px;width:18px;">
</button>
</form>
<button class="hovi" onclick="clearMap()" id="clear1" style="margin-left:50px;border: 2px solid gray;border-top-right-radius: 25px;background:white;border:2px solid black;outline:none;border-bottom-right-radius: 25px;height: 25px; width: 50px;border:none; position: relative; left:81.2px;bottom: 31.5px;">
<img src="images/clear.png" style="border:none;height:18px;margin-top:3px;">
</button>
</div>
<div id="map" style="width:80%;height:100%;background:#ffffff;float:right;"></div>
<script src="jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="scripts/leaflet/leaflet.js"> </script>
<script>
function chk(){
var start=document.getElementById('start').value;
var end=document.getElementById('end').value;
var dataString='start='+start+ '&end='+end;
$.ajax({
type:"post",
url:"data.php",
data:dataString,
cache:false,
success:function(html){
try{
debugger;
var array = JSON.parse(html);
debugger;
}
catch(err){
alert("Enter valid place");
}
getRoot(start,end,array);
}
})
return false;
}
</script>
<script type="text/javascript">
var mapSW=[0,4096],
mapNE=[4096,0];
var map=L.map('map').setView([0,0],1);
L.tileLayer('maps/{z}/{x}/{y}.png',{
minZoom:0,
maxZoom:4,
continuosWorld:false,
noWrap:true,
crs:L.CRS.Simple,
}).addTo(map);
map.setMaxBounds(new L.LatLngBounds(
map.unproject(mapSW,map.getMaxZoom()),
map.unproject(mapNE,map.getMaxZoom())
));
var marker=L.marker([0,0],{
draggable:true,
color:'red'
}).addTo(map);
marker.bindPopup('<b>CLICK FOR LAT LNG</b>').openPopup();
marker.on('dragend',function(e){
marker.getPopup().setContent('clicked'+marker.getLatLng().toString())
})
var marker_atm=L.marker([44.9648,-51.15234],{
}).addTo(map);
marker_atm.bindPopup('<b>SBI ATM</b>')
var entrance=L.marker([47.93107,-44.91211],{
}).addTo(map);
entrance.bindPopup('<b>ENTRANCE</b>');
var marker_community_center=L.marker([49.0378,-37.79297],{
}).addTo(map);
marker_community_center.bindPopup('<b>HOSPITAL</b>');
var marker_bike_parking=L.marker([59.7121,-33.39844],{
}).addTo(map);
marker_bike_parking.bindPopup('<b>TWO WHEELER PARKING</b>');
var marker_post_office=L.marker([64.20638,-10.10531],{
}).addTo(map);
marker_post_office.bindPopup('<b>POST OFFICE</b>');
var marker_power_supply=L.marker([60.19616,-10.01953],{
}).addTo(map);
marker_power_supply.bindPopup('<b>POWER SUPPLY</b>');
var marker_nursing_building=L.marker([58.67694,-27.50977],{
}).addTo(map);
marker_nursing_building.bindPopup('<b>NURSING BUILDING</b>');
var marker_play_ground=L.marker([15.28419,-74.88281],{
}).addTo(map);
marker_play_ground.bindPopup('<b>PLAY GROUND</b>');
var marker_bus_parking=L.marker([35.10193,-43.41797],{
}).addTo(map);
marker_bus_parking.bindPopup('<b>BUS PARKING</b>');
var marker_car_parking=L.marker([40.78054,-3.7793],{
}).addTo(map);
marker_car_parking.bindPopup('<b>CAR PARKING</b>');
var marker_juice_center=L.marker([35.60372,-28.125],{
}).addTo(map);
marker_juice_center.bindPopup('<b>JUICE CENTER</b>')
var marker_garden=L.marker([45.39845,-17.55502],{
}).addTo(map);
marker_garden.bindPopup('<b>GARDEN</b>');
var marker_main_stage=L.marker([52.53627,2.02148],{
}).addTo(map);
marker_main_stage.bindPopup('<b>MAIN STAGE</b>');
var marker_main_building=L.marker([58.1707,7.64648],{
}).addTo(map);
marker_main_building.bindPopup('<b>MAIN BUILDING</b>');
var marker_new_building=L.marker([62.06273,25.57617],{
}).addTo(map);
marker_new_building.bindPopup('<b>NEW BUILDING</b>');
var marker_principal_office=L.marker([49.5373,13.27148],{
}).addTo(map);
marker_principal_office.bindPopup('<b>PRINCIPAL OFFICE</b>');
var marker_office1=L.marker([50.62507,10.2832],{
}).addTo(map);
marker_office1.bindPopup('<b>OFFICE 1</b>');
var marker_office2=L.marker([52.74959,3.25195],{
}).addTo(map);
marker_office2.bindPopup('<b>OFFICE 2</b>');
var marker_computer_center=L.marker([51.67256,11.33789],{
}).addTo(map);
marker_computer_center.bindPopup('<b>COMPUTER CENTER</b>');
var marker_physics_department=L.marker([54.62296,1.8457],{
}).addTo(map);
marker_physics_department.bindPopup('<b>PHYSICS DEPARTMENT</b>');
var marker_chemistry_department=L.marker([56.4139,2.28516],{
}).addTo(map);
marker_chemistry_department.bindPopup('<b>CHEMISTRY DEPARTMENT</b>');
var marker_CS_department=L.marker([53.22577,6.67969],{
}).addTo(map);
marker_CS_department.bindPopup('<b>DEPT of COMPUTER SCIENCE(HOD OFFICE)</b>');
var marker_EC_department=L.marker([54.57206,6.67969],{
}).addTo(map);
marker_EC_department.bindPopup('<b>DEPT OF ELECTRONICS(HOD OFFICE) </b>');
var marker_IS_department=L.marker([55.628,8.70117],{
}).addTo(map);
marker_IS_department.bindPopup('<b>DEPT OF INFORMATION SCIENCE(HOD OFFICE) </b>');
var marker_NT_department=L.marker([58.90465,-1.58203],{
}).addTo(map);
marker_NT_department.bindPopup('<b>DEPT OF NANO TECHNOLOGY(HOD OFFICE) </b>');
var marker_conference_hall=L.marker([57.2315, 21.00586],{
}).addTo(map);
marker_conference_hall.bindPopup('<b>CONFERENCE HALL</b>');
var marker_auditorium=L.marker([54.21386,13.53516],{
}).addTo(map);
marker_auditorium.bindPopup('<b>AUDITORIUM</b>');
var marker_mba_department=L.marker([57.70415,24.60938],{
}).addTo(map);
marker_mba_department.bindPopup('<b>DEPT OF MBA</b>');
var marker_pharmacy_building=L.marker([43.32518,18.98438],{
}).addTo(map);
marker_pharmacy_building.bindPopup('<b>PHARMACY BUILDING</b>');
var marker_boys_hostel=L.marker([-43.32518,-91.05469],{
}).addTo(map);
marker_boys_hostel.bindPopup('<b>BOYS HOSTEL</b>');
var marker_placement_office=L.marker([58.26329, 19.77539],{
}).addTo(map);
marker_placement_office.bindPopup('<b>PLACEMENT OFFICE</b>');
var marker_girls_hostel=L.marker([50.51343,78.046],{
}).addTo(map);
marker_girls_hostel.bindPopup('<b>GIRLS HOSTEL</b>');
var marker_architecture_building=L.marker([31.65338,47.8125],{
}).addTo(map);
marker_architecture_building.bindPopup('<b>ARCHITECTURE BUILDING</b>');
var marker_architecture_department=L.marker([6.66461,45.61523],{
}).addTo(map);
marker_architecture_department.bindPopup('<b>ARCHITECTURE DEPARTMENT(HOD OFFICE)</b>');
var marker_mathematics_department=L.marker([20.87934,29.9707],{
}).addTo(map);
marker_mathematics_department.bindPopup('<b>DEPT OF MATHEMATICS</b>');
var marker_animal_house=L.marker([53.95609,48.51563],{
}).addTo(map);
marker_animal_house.bindPopup('<b>ANIMAL HOUSE</b>');
var marker_waste_disposel=L.marker([-44.59047,5.625],{
}).addTo(map);
marker_waste_disposel.bindPopup('<b>GARBAGE</b>');
var marker_mechanical_workshops_building=L.marker([6.3153,-51.50391],{
}).addTo(map);
marker_mechanical_workshops_building.bindPopup('<b>MECHANICAL WORKSHOP</b>');
var marker_mechanical_building=L.marker([21.1255,-24.25781],{
}).addTo(map);
marker_mechanical_building.bindPopup('<b>MECHANICAL BUILDING</b>');
var marker_canteen_1=L.marker([15.28419,-11.95313],{
}).addTo(map);
marker_canteen_1.bindPopup('<b>CANTEEN 1</b>');
var marker_canteen_2=L.marker([8.66792,-17.57813],{
}).addTo(map);
marker_canteen_2.bindPopup('<b>CANTEEN 2</b>');
var marker_bekary=L.marker([11.0059,-13.53516],{
}).addTo(map);
marker_bekary.bindPopup('<b>BEKERY</b>');
var marker_mechanical_department=L.marker([12.98315,-15.20508],{
}).addTo(map);
marker_mechanical_department.bindPopup('<b>DEPT OF MECHANICAL</b>');
var marker_aeronautical_department=L.marker([13.06878,-20.30273],{
}).addTo(map);
marker_aeronautical_department.bindPopup('<b>DEPT OF AERONAUTICAL</b>');
var marker_marine_department=L.marker([16.55196,-20.30273],{
}).addTo(map);
marker_marine_department.bindPopup('<b>DEPT OF MARINE</b>')
var marker_library=L.marker([-24.20589,-18.10547],{
}).addTo(map);
marker_library.bindPopup('<b>LIBRARY</b>')
var marker_digital_library=L.marker([-23.24135,-21.7688],{
}).addTo(map);
marker_digital_library.bindPopup('<b>DIGITAL LIBRARY</b>');
var marker_electrical_building=L.marker([-16.04581,-33.04688],{
}).addTo(map);
marker_electrical_building.bindPopup('<b>ELECTRICAL BUILDING</b>');
var marker_electrical_department=L.marker([-32.7688,-43.24219],{
}).addTo(map);
marker_electrical_department.bindPopup('<b>ELECTRICAL DEPARTMENT</b>');
var marker_automobile_department=L.marker([-34.88593,-7.99805],{
}).addTo(map);
marker_automobile_department.bindPopup('<b>AUTOMOBILE DEPARTMENT</b>');
</script>
<script>
function getRoot(start,end,arr){
var polylines;
if (polylines != undefined )
{
polylines.removeFrom(map);
}
var pop=document.getElementById('end').value;
var popup=pop.toLowerCase();
clearMap();
var polylines = L.polyline(arr,{color:'red'}).addTo(map);
switch(popup){
case 'entrance' : entrance.bindPopup('<b>START POSITION</b>').openPopup();
break;
case 'juice centre' : marker_juice_center.bindPopup('<b>JUICE CENTER</b>').openPopup();
break;
case 'hospital' : marker_community_center.bindPopup('<b>HOSPITAL</b>').openPopup();
break;
case 'atm' :marker_atm.bindPopup('<b>SBI ATM</b>').openPopup();
break;
case 'nursing building' : marker_nursing_building.bindPopup('<b>NURSING BUILDING</b>').openPopup();
break;
case 'automobile department' : marker_automobile_department.bindPopup('<b>AUTOMOBILE DEPARTMENT</b>').openPopup();
break;
case 'electrical department' :marker_electrical_department.bindPopup('<b>ELECTRICAL DEPARTMENT</b>').openPopup();
break;
case 'electrical building' :marker_electrical_building.bindPopup('<b>ELECTRICAL BUILDING</b>').openPopup();
break;
case 'digital library': marker_digital_library.bindPopup('<b>DIGITAL LIBRARY</b>').openPopup();
break;
case 'library' : marker_library.bindPopup('<b>LIBRARY</b>').openPopup();
break;
case 'marine department' : marker_marine_department.bindPopup('<b>DEPT OF MARINE</b>').openPopup();
break;
case 'aeronautical department':marker_aeronautical_department.bindPopup('<b>DEPT OF AERONAUTICAL</b>').openPopup();
break;
case 'mechanical department':marker_mechanical_department.bindPopup('<b>DEPT OF MECHANICAL</b>').openPopup();
break;
case 'bakery':marker_bekary.bindPopup('<b>BEKERY</b>').openPopup();
break;
case 'canteen' : marker_canteen_2.bindPopup('<b>CANTEEN 2</b>').openPopup();
break;
case 'canteen 1': marker_canteen_1.bindPopup('<b>CANTEEN 1</b>').openPopup();
break;
case 'mechanical building': marker_mechanical_building.bindPopup('<b>MECHANICAL BUILDING</b>').openPopup();
break;
case 'mechanical workshop':marker_mechanical_workshops_building.bindPopup('<b>MECHANICAL WORKSHOP</b>').openPopup();
break;
case 'garbage': marker_waste_disposel.bindPopup('<b>GARBAGE</b>').openPopup();
break;
case 'animal house':marker_animal_house.bindPopup('<b>ANIMAL HOUSE</b>').openPopup();
break;
case 'mathematics department': marker_mathematics_department.bindPopup('<b>DEPT OF MATHEMATICS</b>').openPopup();
break;
case 'architecture department':marker_architecture_department.bindPopup('<b>ARCHITECTURE DEPARTMENT(HOD OFFICE)</b>').openPopup();
break;
case 'architecture building':marker_architecture_building.bindPopup('<b>ARCHITECTURE BUILDING</b>').openPopup();
break;
case 'girls hostel':marker_girls_hostel.bindPopup('<b>GIRLS HOSTEL</b>').openPopup();
break;
case 'placement office' : marker_placement_office.bindPopup('<b>PLACEMENT OFFICE</b>').openPopup();
break;
case 'boys hostel':marker_boys_hostel.bindPopup('<b>BOYS HOSTEL</b>').openPopup();
break;
case 'pharmacy building': marker_pharmacy_building.bindPopup('<b>PHARMACY BUILDING</b>').openPopup();
break;
case 'mba department':marker_mba_department.bindPopup('<b>DEPT OF MBA</b>').openPopup();
break;
case 'auditorium': marker_auditorium.bindPopup('<b>AUDITORIUM</b>').openPopup();
break;
case 'conference hall': marker_conference_hall.bindPopup('<b>CONFERENCE HALL</b>').openPopup();
break;
case 'nanotechnology department': marker_NT_department.bindPopup('<b>DEPT OF NANO TECHNOLOGY(HOD OFFICE) </b>').openPopup();
break;
case 'information science department':marker_IS_department.bindPopup('<b>DEPT OF INFORMATION SCIENCE(HOD OFFICE) </b>').openPopup();
break;
case 'electronics department':marker_EC_department.bindPopup('<b>DEPT OF ELECTRONICS(HOD OFFICE) </b>').openPopup();
break;
case 'computer science department': marker_CS_department.bindPopup('<b>DEPT of COMPUTER SCIENCE(HOD OFFICE)</b>').openPopup();
break;
case 'chemistry department': marker_chemistry_department.bindPopup('<b>CHEMISTRY DEPARTMENT</b>').openPopup();
break;
case 'physics department': marker_physics_department.bindPopup('<b>PHYSICS DEPARTMENT</b>').openPopup();
break;
case 'computer center':marker_computer_center.bindPopup('<b>COMPUTER CENTER</b>').openPopup();
break;
case 'office 2': marker_office2.bindPopup('<b>OFFICE 2</b>').openPopup();
break;
case 'office 1': marker_office1.bindPopup('<b>OFFICE 1</b>').openPopup();
break;
case 'principal office': marker_principal_office.bindPopup('<b>PRINCIPAL OFFICE</b>').openPopup();
break;
case 'new building':marker_new_building.bindPopup('<b>NEW BUILDING</b>').openPopup();
break;
case 'main building':marker_main_building.bindPopup('<b>MAIN BUILDING</b>').openPopup();
break;
case 'mainstage':marker_main_stage.bindPopup('<b>MAIN STAGE</b>').openPopup();
break;
case 'garden':marker_garden.bindPopup('<b>GARDEN</b>').openPopup();
break;
case 'car parking':marker_car_parking.bindPopup('<b>CAR PARKING</b>').openPopup();
break;
case 'bus parking':marker_bus_parking.bindPopup('<b>BUS PARKING</b>').openPopup();
break;
case 'playground':marker_play_ground.bindPopup('<b>PLAY GROUND</b>').openPopup();
break;
case 'nursing building':marker_nursing_building.bindPopup('<b>NURSING BUILDING</b>').openPopup();
break;
case 'power supply':marker_power_supply.bindPopup('<b>POWER SUPPLY</b>').openPopup();
break;
case 'post office': marker_post_office.bindPopup('<b>POST OFFICE</b>').openPopup();
break;
case 'bike parking': marker_bike_parking.bindPopup('<b>TWO WHEELER PARKING</b>').openPopup();
break;
default : alert("Enter valid place");
}
}
</script>
<script>
function clearMap() {
location.reload();
document.getElementById('start').value=""; //clearing textBox1
document.getElementById('end').value=""; //clearing textBox2
}
function clearMap() {
document.getElementById('start').value=""; //clearing textBox1
document.getElementById('end').value=""; //clearing textBox2
m=map;
for(i in m._layers) {
if(m._layers[i]._path != undefined) {
try {
m.removeLayer(m._layers[i]);
}
catch(e){
}
}
}
}
</script>
<script>
function say_search(){
if(navigator.onLine){
$('div.mess').fadeIn(2000);
$('div.mess').fadeOut(1000);
try{
var recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition || window.mozSpeechRecognition || window.msSpeechRecognition)(); //using apis
recognition.lang = 'en-IN'; //speech recognition accent
recognition.interimResults = false;
recognition.maxAlternatives = 5;
recognition.start(); //start recognition
recognition.onresult = function(event) { //event handler for speech recognition
var finalrecord= event.results[0][0].transcript; //storing the recorded word in a variable
if(document.getElementById('start').value==""){
document.getElementById('start').value= finalrecord; //displaying in textBox1
console.log('You said: ', event.results[0][0].transcript);
var msg = new SpeechSynthesisUtterance(finalrecord);
window.speechSynthesis.speak(msg); //say back the recorded word
msg.volume=1; //setting volume
}
else{
document.getElementById('end').value= finalrecord; //displaying in textBox2
console.log('You said: ', event.results[0][0].transcript);
var msg = new SpeechSynthesisUtterance(finalrecord);
window.speechSynthesis.speak(msg); //say back the recorded word
msg.volume=1; //setting volume
}
}
}
catch(err){
alert("action is supported in chrome only,you can manually enter the from.. and to.. fields if you want to cotinue"); //browser compatibility check and alert
}
}
else{
alert("internet connection required\nCheck internet connection");
}
}
</script>
<script type="text/javascript">
var beep = new Audio();
beep.src = "beep.mp3" ; //beep sound on mic button click
</script>
</body>
</html>