-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.html
29 lines (28 loc) · 975 Bytes
/
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
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="visualizer.js"></script>
<script type="text/javascript">
let initialized = false;
window.onload = function() {
fileinput.onchange = function() {
var files = this.files;
var file = URL.createObjectURL(files[0]);
player.src = file;
player.play();
if (!initialized) {
initializeVisualizer($("canvas")[0], $("audio")[0]);
initialized = true;
}
updateSongText(files[0].name);
}
};
</script>
</head>
<body style="background-color: #252833">
<input id="fileinput" style="color:white;" type="file" accept="audio/*" />
<audio id="player"></audio>
<canvas style="padding:0; margin:0; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" id="canvas" width="920px" height="50px"></canvas>
</body>
</html>