Skip to content

Instantly share code, notes, and snippets.

View hakasenyang's full-sized avatar
I may be slow to respond.

Hakase hakasenyang

I may be slow to respond.
View GitHub Profile
@hakasenyang
hakasenyang / graphicEQUrl.js
Created April 19, 2019 03:50 — forked from paceaux/graphicEQUrl.js
Graphic EQ in a url
/* Courtesy of Jake Albaugh: https://twitter.com/jake_albaugh/status/1118611365508337665 */
const bars = ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"];
const ctx = new AudioContext();
const analyser = ctx.createAnalyser();
analyser.fftSize = 32;
const uIntArray = new Uint8Array(16);
navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => {
ctx.createMediaStreamSource(stream).connect(analyser);
updateUrl();