(function(q){var b=function(){};b.__name__=!0;b.main=function(){window.addEventListener("DOMContentLoaded",function(){b.div=window.document.getElementById("audio-div");b.canvas=window.document.getElementById("audio-canvas");null==b.canvas&&(b.canvas=window.document.createElement("canvas"),b.canvas.id="audio-canvas",b.div.appendChild(b.canvas));b.canvas.width=b.div.clientWidth;b.canvas.height=b.div.clientHeight;b.userMediaInfoDisplay=window.document.getElementById("audio-info");null==b.userMediaInfoDisplay&& (b.userMediaInfoDisplay=window.document.createElement("p"),b.userMediaInfoDisplay.id="audio-info",b.userMediaInfoDisplay.style.font='12pt ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", "Open Sans", sans-serif',b.userMediaInfoDisplay.style.textAlign="center",b.userMediaInfoDisplay.style.padding="8px",b.userMediaInfoDisplay.style.position="absolute",b.userMediaInfoDisplay.style.top="45%",b.userMediaInfoDisplay.style.width="100%",b.userMediaInfoDisplay.style.color= "#111111",b.userMediaInfoDisplay.style.display="none",b.div.appendChild(b.userMediaInfoDisplay));b.userMediaInfoDisplay.innerHTML="Waiting for microphone...";b.btnStart=window.document.getElementById("audio-start");b.btnStart.style.width="100%";b.btnStart.style.height="100%";b.btnStart.style.position="absolute";b.btnStart.style.display="block";b.btnStart.addEventListener("click",function(){b.btnStart.style.display="none";b.userMediaInfoDisplay.style.display="block";b.canvas.width=b.div.clientWidth; b.canvas.height=b.div.clientHeight;navigator.mediaDevices.getUserMedia({audio:!0}).then(b.onGetUserMedia,b.onGetUserMediaFailed)});b.ctx=b.canvas.getContext("2d")})};b.onGetUserMediaFailed=function(a){window.console.log("Getting user media failed: "+n.string(a));b.userMediaInfoDisplay.innerHTML="NotFoundError"==a.name?"We can't find your microphone - that most probably means that it's either not connected, broken, or you don't have the proper webcam drivers (see below)":"Microphone not authorized. Please check your media permissions settings."}; b.onGetUserMedia=function(a){b.canvas.width=b.div.clientWidth;b.canvas.height=b.div.clientHeight;b.userMediaInfoDisplay.style.display="none";b.actx=new AudioContext;b.analyser=b.actx.createAnalyser();b.source=b.actx.createMediaStreamSource(a);b.source.connect(b.analyser);b.visualize(a)};b.visualize=function(a){b.ctx.clearRect(0,0,b.canvas.width,b.canvas.height);var d=.5*b.canvas.height,c=b.canvas.width/b.analyser.frequencyBinCount;var m=.5*b.canvas.height;var e=new w(b.analyser.frequencyBinCount), f=null;f=function(){window.requestAnimationFrame(f);b.analyser.getFloatTimeDomainData(e);b.ctx.fillStyle="white";b.ctx.fillRect(0,0,b.canvas.width,b.canvas.height);b.ctx.lineWidth=1;b.ctx.strokeStyle="black";b.ctx.beginPath();for(var a=0,h=e.length;a>>23&255,c=a&8388607;return 0== c&&0==d?0:(1-(a>>>31<<1))*(1+Math.pow(2,-23)*c)*Math.pow(2,d-127)};p.floatToI32=function(a){if(0==a)return 0;var d=0>a?-a:a,c=Math.floor(Math.log(d)/.6931471805599453);-127>c?c=-127:128c&&(d=0,++c);return(0>a?-2147483648:0)|c+127<<23|d};var h=function(a){Error.call(this);this.val=a;this.message=String(a);Error.captureStackTrace&&Error.captureStackTrace(this,h)};h.__name__=!0;h.wrap=function(a){return a instanceof Error?a:new h(a)}; h.__super__=Error;h.prototype=function(a,d){function c(){}c.prototype=a;a=new c;for(var b in d)a[b]=d[b];d.toString!==Object.prototype.toString&&(a.toString=d.toString);return a}(Error.prototype,{__class__:h});var f=function(){};f.__name__=!0;f.getClass=function(a){if(a instanceof Array&&null==a.__enum__)return Array;var d=a.__class__;if(null!=d)return d;a=f.__nativeClassName(a);return null!=a?f.__resolveNativeClass(a):null};f.__string_rec=function(a,d){if(null==a)return"null";if(5<=d.length)return"<...>"; var c=typeof a;"function"==c&&(a.__name__||a.__ename__)&&(c="object");switch(c){case "function":return"";case "object":if(a instanceof Array){if(a.__enum__){if(2==a.length)return a[0];c=a[0]+"(";d+="\t";for(var b=2,e=a.length;b>2);c=[];for(e=0;e>8&255),a.push(e>>16&255),a.push(e>>>24);c.byteLength=c.length<<2;c.byteOffset=0;c.buffer=new g(a)}else throw new h("TODO "+n.string(a));c.subarray=l._subarray;c.set=l._set;return c}; l._set=function(a,d){if(f.__instanceof(a.buffer,g)){if(a.byteLength+d>this.byteLength)throw new h("set() outside of range");for(var b=0,m=a.byteLength;bthis.byteLength)throw new h("set() outside of range");b=0;for(m=a.length;bthis.byteLength)throw new h("set() outside of range");for(var c=0,d=a.byteLength;cthis.byteLength)throw new h("set() outside of range");c=0;for(d=a.length;c