commit
b672f88f65
@ -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>
|
Loading…
Reference in new issue