1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-12-02 04:49:44 +00:00
8bitworkshop/lib/makewav.js

40 lines
217 KiB
JavaScript
Raw Normal View History

var makewav = (function() {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
return (
function(makewav) {
makewav = makewav || {};
var Module=typeof makewav!=="undefined"?makewav:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){var ret=tryParseAsDataURI(filename);if(ret){return binary?ret:ret.toString()}if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){var data=tryParseAsDataURI(f);if(data){return intArrayToString(data)}return read(f)}}readBinary=function readBinary(f){var data;data=tryParseAsDataURI(f);if(data){return data}if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function shell_read(url){try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText}catch(err){var data=tryParseAsDataURI(url);if(data){return intArrayToString(data)}throw err}};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}catch(err){var data=tryParseAsDataURI(url);if(data){return data}throw err}}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}var data=tryParseAsDataURI(url);if(data){onload(data.buffer);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(consol
// EMSCRIPTEN_START_ASM
function a(asmLibraryArg,wasmMemory,wasmTable){var scratchBuffer=new ArrayBuffer(8);var b=new Int32Array(scratchBuffer);var c=new Float32Array(scratchBuffer);var d=new Float64Array(scratchBuffer);function e(index){return b[index]}function f(index,value){b[index]=value}function g(){return d[0]}function h(value){d[0]=value}function i(low,high){b[0]=low;b[1]=high}function j(value){c[0]=value}function k(){return c[0]}function l(global,env,buffer){var m=env.memory;var n=wasmTable;var o=new global.Int8Array(buffer);var p=new global.Int16Array(buffer);var q=new global.Int32Array(buffer);var r=new global.Uint8Array(buffer);var s=new global.Uint16Array(buffer);var t=new global.Uint32Array(buffer);var u=new global.Float32Array(buffer);var v=new global.Float64Array(buffer);var w=global.Math.imul;var x=global.Math.fround;var y=global.Math.abs;var z=global.Math.clz32;var A=global.Math.min;var B=global.Math.max;var C=global.Math.floor;var D=global.Math.ceil;var E=global.Math.sqrt;var F=env.abort;var G=global.NaN;var H=global.Infinity;var I=env.exit;var J=env.__sys_open;var K=env.__sys_fcntl64;var L=env.__sys_ioctl;var M=env.fd_write;var N=env.fd_close;var O=env.fd_read;var P=env.emscripten_resize_heap;var Q=env.emscripten_memcpy_big;var R=env.setTempRet0;var S=env.fd_seek;var T=5325824;var U=82784;var V=0;
// EMSCRIPTEN_START_FUNCS
function kc(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;l=T-16|0;T=l;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{if(a>>>0<=244){f=q[20572];h=a>>>0<11?16:a+11&-8;b=h>>>3|0;a=f>>>b|0;if(a&3){d=b+((a^-1)&1)|0;b=d<<3;e=q[b+82336>>2];a=e+8|0;c=q[e+8>>2];b=b+82328|0;l:{if((c|0)==(b|0)){q[20572]=Rc(d)&f;break l}q[c+12>>2]=b;q[b+8>>2]=c}b=d<<3;q[e+4>>2]=b|3;b=b+e|0;q[b+4>>2]=q[b+4>>2]|1;break a}k=q[20574];if(h>>>0<=k>>>0){break k}if(a){c=a<<b;a=2<<b;a=c&(0-a|a);b=(0-a&a)+ -1|0;a=b>>>12&16;c=a;b=b>>>a|0;a=b>>>5&8;c=c|a;b=b>>>a|0;a=b>>>2&4;c=c|a;b=b>>>a|0;a=b>>>1&2;c=c|a;b=b>>>a|0;a=b>>>1&1;c=(c|a)+(b>>>a|0)|0;a=c<<3;g=q[a+82336>>2];b=q[g+8>>2];a=a+82328|0;m:{if((b|0)==(a|0)){f=Rc(c)&f;q[20572]=f;break m}q[b+12>>2]=a;q[a+8>>2]=b}a=g+8|0;q[g+4>>2]=h|3;d=g+h|0;b=c<<3;e=b-h|0;q[d+4>>2]=e|1;q[b+g>>2]=e;if(k){b=k>>>3|0;c=(b<<3)+82328|0;h=q[20577];b=1<<b;n:{if(!(b&f)){q[20572]=b|f;b=c;break n}b=q[c+8>>2]}q[c+8>>2]=h;q[b+12>>2]=h;q[h+12>>2]=c;q[h+8>>2]=b}q[20577]=d;q[20574]=e;break a}i=q[20573];if(!i){break k}b=(i&0-i)+ -1|0;a=b>>>12&16;c=a;b=b>>>a|0;a=b>>>5&8;c=c|a;b=b>>>a|0;a=b>>>2&4;c=c|a;b=b>>>a|0;a=b>>>1&2;c=c|a;b=b>>>a|0;a=b>>>1&1;b=q[((c|a)+(b>>>a|0)<<2)+82592>>2];d=(q[b+4>>2]&-8)-h|0;c=b;while(1){o:{a=q[c+16>>2];if(!a){a=q[c+20>>2];if(!a){break o}}c=(q[a+4>>2]&-8)-h|0;e=c>>>0<d>>>0;d=e?c:d;b=e?a:b;c=a;continue}break}j=q[b+24>>2];e=q[b+12>>2];if((e|0)!=(b|0)){a=q[b+8>>2];q[a+12>>2]=e;q[e+8>>2]=a;break b}c=b+20|0;a=q[c>>2];if(!a){a=q[b+16>>2];if(!a){break j}c=b+16|0}while(1){g=c;e=a;c=a+20|0;a=q[c>>2];if(a){continue}c=e+16|0;a=q[e+16>>2];if(a){continue}break}q[g>>2]=0;break b}h=-1;if(a>>>0>4294967231){break k}a=a+11|0;h=a&-8;i=q[20573];if(!i){break k}a=a>>>8|0;g=0;p:{if(!a){break p}g=31;if(h>>>0>16777215){break p}b=a+1048320>>>16&8;a=a<<b;d=a+520192>>>16&4;a=a<<d;c=a+245760>>>16&2;a=(a<<c>>>15|0)-(c|(b|d))|0;g=(a<<1|h>>>a+21&1)+28|0}c=0-h|0;d=q[(g<<2)+82592>>2];q:{r:{s:{if(!d){a=0;break s}b=h<<((g|0)==31?0:25-(g>>>1|0)|0);a=0;while(1){t:{f=(q[d+4>>2]&-8)-h|0;if(f>>>0>=c>>>0){break t}e=d;c=f;if(c){break t}c=0;a=d;break r}f=q[d+20>>2];d=q[((b>>>29&4)+d|0)+16>>2];a=f?(f|0)==(d|0)?a:f:a;b=b<<((d|0)!=0);if(d){continue}break}}if(!(a|e)){a=2<<g;a=(0-a|a)&i;if(!a){break k}b=(a&0-a)+ -1|0;a=b>>>12&16;d=a;b=b>>>a|0;a=b>>>5&8;d=d|a;b=b>>>a|0;a=b>>>2&4;d=d|a;b=b>>>a|0;a=b>>>1&2;d=d|a;b=b>>>a|0;a=b>>>1&1;a=q[((d|a)+(b>>>a|0)<<2)+82592>>2]}if(!a){break q}}while(1){b=(q[a+4>>2]&-8)-h|0;d=b>>>0<c>>>0;c=d?b:c;e=d?a:e;b=q[a+16>>2];if(b){a=b}else{a=q[a+20>>2]}if(a){continue}break}}if(!e|c>>>0>=q[20574]-h>>>0){break k}g=q[e+24>>2];b=q[e+12>>2];if((e|0)!=(b|0)){a=q[e+8>>2];q[a+12>>2]=b;q[b+8>>2]=a;break c}d=e+20|0;a=q[d>>2];if(!a){a=q[e+16>>2];if(!a){break i}d=e+16|0}while(1){f=d;b=a;d=a+20|0;a=q[d>>2];if(a){continue}d=b+16|0;a=q[b+16>>2];if(a){continue}break}q[f>>2]=0;break c}c=q[20574];if(c>>>0>=h>>>0){d=q[20577];b=c-h|0;u:{if(b>>>0>=16){q[20574]=b;a=d+h|0;q[20577]=a;q[a+4>>2]=b|1;q[c+d>>2]=b;q[d+4>>2]=h|3;break u}q[20577]=0;q[20574]=0;q[d+4>>2]=c|3;a=c+d|0;q[a+4>>2]=q[a+4>>2]|1}a=d+8|0;break a}j=q[20575];if(j>>>0>h>>>0){b=j-h|0;q[20575]=b;c=q[20578];a=c+h|0;q[20578]=a;q[a+4>>2]=b|1;q[c+4>>2]=h|3;a=c+8|0;break a}a=0;i=h+47|0;b=i;if(q[20690]){c=q[20692]}else{q[20693]=-1;q[20694]=-1;q[20691]=4096;q[20692]=4096;q[20690]=l+12&-16^1431655768;q[20695]=0;q[20683]=0;c=4096}g=b+c|0;f=0-c|0;c=g&f;if(c>>>0<=h>>>0){break a}e=q[20682];if(e){d=q[20680];b=d+c|0;if(b>>>0<=d>>>0|b>>>0>e>>>0){break a}}if(r[82732]&4){break f}v:{w:{d=q[20578];if(d){a=82736;while(1){b=q[a>>2];if(b+q[a+4>>2]>>>0>d>>>0?b>>>0<=d>>>0:0){break w}a=q[a+8>>2];if(a){continue}break}}b=pc(0);if((b|0)==-1){break g}f=c;d=q[20691];a=d+ -1|0;if(a&b){f=(c-b|0)+(a+b&0-d)|0}if(f>>>0<=h>>>0|f>>>0>2147483646){break g}e=q[20682];if(e){d=q[20680];a=d+f|0;if(a>>>0<=d>>>0|a>>>0>e>>>0){break g}}a=pc(f);if((b|0)!=(a|0)){break v}break e}f=f&g-j;if(f>>>0>2147483646){break g}b=pc(f);if((b|0)==(q[a>>2]+q[a+4>>2]|0)){break h}a=b}if(!((a|0)==-1|h+48>>>0<=f>>>0)){b=q[20692];b=b+(i-f|0)&0-b;if(b>>>0>2147483646){b=a;break e}if((pc(b)|0)!=-1){f=b+f|0;b=a;break e}pc(0-f|0);break g}b=a;if((a|0)!=-1){break e}break g}e=0;b
function zc(a,b){var c=0;c=T-16|0;T=c;q[c+12>>2]=b;Va(q[1680],a,b);T=c+16|0}function ta(a){var b=0;b=q[3500];q[3500]=b>>>8^q[((b&255^a)<<2)+12976>>2]}function bb(a,b,c){var d=0;d=T-16|0;T=d;q[d+12>>2]=c;Va(a,b,c);T=d+16|0}function Da(a,b,c,d){if(q[a+76>>2]<=-1){Ca(a,b,c,d);return}Ca(a,b,c,d)}function za(a,b){var c=0;c=T-16|0;T=c;q[c+12>>2]=b;Aa(a,b);T=c+16|0}function Hc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return n[a](b,c,d)|0}function qb(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;V=0;return 0}function mb(a,b,c){a=a|0;b=b|0;c=c|0;return kb(a,b,c)|0}function Bb(a,b){a=Ab(a,b);return r[a|0]==(b&255)?a:0}function Rb(a){if(!a){return 0}q[20555]=a;return-1}function Ia(a,b){if(!a){return 0}return Ha(a,b)}function Ma(a,b,c){if(!(r[a|0]&32)){xc(b,c,a)}}function Jc(a,b,c){a=a|0;b=b|0;c=c|0;n[a](b,c)}function Kc(a,b){a=a|0;b=b|0;return n[a](b)|0}function Fc(a){a=a|0;a=T-a&-16;T=a;return a|0}function ob(a){a=a|0;return N(q[a+60>>2])|0}function Pc(a,b,c,d){a=Nc(a,b,c,d);return a}function fb(a){return(a|0)==32|a+ -9>>>0<5}function Cb(a){return a+ -65>>>0<26?a|32:a}function Qc(a,b,c){return Oc(a,b,c)}function Ga(a){return a+ -48>>>0<10}function Ea(a,b,c){Da(a,b,b>>31,c)}function Gc(a){a=a|0;return F()|0}function Fb(a,b){Eb(a,b);return a}function Va(a,b,c){Ka(a,b,c,0,0)}function pb(a){a=a|0;return 0}function rb(a){cb(a,q[1680])}function Mc(a,b){i(a|0,b|0)}function Gb(){return 82220}function Ec(a){a=a|0;T=a}function Dc(){return T|0}function ea(){}
// EMSCRIPTEN_END_FUNCS
n[1]=Ba;n[2]=Ta;n[3]=Ua;n[4]=Za;n[5]=Wa;n[6]=sb;n[7]=ob;n[8]=mb;n[9]=pb;n[10]=qb;function W(){return buffer.byteLength/65536|0}return{"__wasm_call_ctors":ea,"malloc":kc,"free":lc,"main":xa,"__errno_location":Gb,"stackSave":Dc,"stackRestore":Ec,"stackAlloc":Fc,"__growWasmMemory":Gc,"dynCall_iiii":Hc,"dynCall_iidiiii":Ic,"dynCall_vii":Jc,"dynCall_jiji":Lc,"dynCall_ii":Kc}}for(var X=new Uint8Array(123),Y=25;Y>=0;--Y){X[48+Y]=52+Y;X[65+Y]=Y;X[97+Y]=26+Y}X[43]=62;X[47]=63;function Z(uint8Array,offset,b64){var _,$,Y=0,aa=offset,ba=b64.length,ca=offset+(ba*3>>2)-(b64[ba-2]=="=")-(b64[ba-1]=="=");for(;Y<ba;Y+=4){_=X[b64.charCodeAt(Y+1)];$=X[b64.charCodeAt(Y+2)];uint8Array[aa++]=X[b64.charCodeAt(Y)]<<2|_>>4;if(aa<ca)uint8Array[aa++]=_<<4|$>>2;if(aa<ca)uint8Array[aa++]=$<<6|X[b64.charCodeAt(Y+3)]}}var da=new Uint8Array(wasmMemory.buffer);Z(da,1024,"TWFnaWNhcmQgKENvbW1hVmlkKQBWaWRlbyBMaWZlIChDb21tYVZpZCkARnJvZ2dlciBJSSAtIFRocmVlZGVlcCEAR3lydXNzIFtiXQBHeXJ1c3MASmFtZXMgQm9uZCAwMDcgW2JdAEphbWVzIEJvbmQgMDA3AE1vbnRlenVtYSdzIFJldmVuZ2UATXIuIERvISdzIENhc3RsZQBQb3BleWUAUS1iZXJ0J3MgUXViZXMgW2FdAFEtYmVydCdzIFF1YmVzAFN0YXIgV2FycyAtIERlYXRoIFN0YXIgQmF0dGxlIChQYXJrZXIgQnJvcykAU3RhciBXYXJzIC0gVGhlIEFyY2FkZSBHYW1lIChQYXJrZXIgQnJvcykAU3VwZXIgQ29icmEgW2JdAFN1cGVyIENvYnJhAFRvb3RoIFByb3RlY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gAFdhcm5pbmchICVkIC53YXYgZmlsZXMgd2lsbCBiZSBjcmVhdGVkLCBDb250aW51ZT8gKFkvTikAJWMAQ29udmVydGluZyAlZCBmaWxlJXMgZm9yIHVzZSB3aXRoIHRoZSAlczoKAHMAU3VwZXJjaGFyZ2VyAEN1dHRsZSBDYXJ0ACAgVXNpbmcgJXMgJXNraHogADE2LWJpdCBzdGVyZW8AOC1iaXQgbW9ubwAyMgA0NABkaXJlY3QgYXVkaW8ALndhdiBmb3JtYXQAIHdpdGggYSAlMC4yZiBzZWNvbmQgaGVhZGVyIHRvbmUKACAgKHplcm8gYml0L29uZSBiaXQpIGxlbmd0aHMgPSAoJWQvJWQpACBpbXBsZW1lbnRlZCB3aXRoICVzIHdhdmUgZm9ybXMKAHNxdWFyZQBzaW5lACVzIC0+IAAuKwAlcy53YXYAKwByYgBFUlJPUjogdW5hYmxlIHRvIG9wZW4gLmJpbiBmaWxlICVzCgBJbnZhbGlkIGZpbGUgc2l6ZSBmb3IgU3VwZXJjaGFyZ2VyLCBza2lwcGluZwoAd2IARVJST1I6IHVuYWJsZSB0byBjcmVhdGUgd2F2RmlsZSAlcwoAJXMAQmFua3N3aXRjaCBzY2hlbWUgJXMgaXMgbm90IGxlZ2FsIGZvciBhICVkSyBST00KAEVS
// EMSCRIPTEN_END_ASM
)(asmLibraryArg,wasmMemory,wasmTable);return{"exports":exports}},instantiate:function(binary,info){return{then:function(ok){ok({"instance":new WebAssembly.Instance(new WebAssembly.Module(binary))})}}},RuntimeError:Error};wasmBinary=[];if(typeof WebAssembly!=="object"){err("no native wasm support detected")}function setValue(ptr,value,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":HEAP8[ptr>>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":11,"maximum":11+0,"element":"anyfunc"});var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func.apply(null,cArgs);ret=convertReturnValue(ret);if(stack!==0)stackRestore(stack);return ret}var ALLOC_NONE=3;function getMemory(size){if(!runtimeInitialized)return dynamicAlloc(size);return _malloc(size)}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx<endPtr){var u0=heap[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;e
return makewav;//.ready
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = makewav;
else if (typeof define === 'function' && define['amd'])
define([], function() { return makewav; });
else if (typeof exports === 'object')
exports["makewav"] = makewav;