-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
48 lines (39 loc) · 1015 Bytes
/
index.html
File metadata and controls
48 lines (39 loc) · 1015 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
44
45
46
47
48
<!doctype html>
<html>
<head>
<script src="microphone.js"></script>
<script src="js/raphael.js"></script>
<script language="JavaScript" src="js/custom.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<script>
var mic = new Microphone(function(){//this function is called when user allow us to access microphone.
//sample handler
mic.onSamplesAvailable = function(data,channelCount){
console.log(data);
};
//set sample rate
mic.sampleRate = 44100;
//get list of microphones available
console.log(mic.getMicrophoneList());
//get sample rate
console.log(mic.sampleRate);
//get microphone name in use
console.log(mic.name);
//starts streaming
mic.start();
//stops streaming after 1 second
setTimeout(function(){
mic.stop();
},2000);
});
</script>
<div>
SCREEEEAAAAAM!!!!!!!!!!!
<input type=button value="Game Start" onClick="game()">
</div>
<div id="draw">
</div>
</body>
</html>