first commit

This commit is contained in:
kolaente 2019-04-18 13:45:30 +02:00
commit b672f88f65
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 19 additions and 0 deletions

19
index.html Normal file
View File

@ -0,0 +1,19 @@
<script>
let l = ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"];
let x = new AudioContext();
var a = x.createAnalyser();
a.fftSize = 32;
let d = new Uint8Array(16);
navigator.mediaDevices.getUserMedia({ audio: true }).then(s => {
x.createMediaStreamSource(s).connect(a);
z();
});
function z() {
setTimeout(z, 40);
a.getByteFrequencyData(d);
let s = [];
d.forEach(v => s.push(
l[Math.floor((v / 255) * 8)]));
location.hash = document.title = s.join("");
}
</script>