lmz commited on
Commit
243163b
1 Parent(s): de8f7be

Upload 10 files

Browse files
assets/audio-processor-BUNQrM5u.js ADDED
@@ -0,0 +1 @@
 
 
1
+ (function(){"use strict";function r(f){return(f*1e3/sampleRate).toFixed(1)}function i(f){return Math.round(f*sampleRate/1e3)}class u extends AudioWorkletProcessor{constructor(){super(),console.log("Moshi processor lives",currentFrame,sampleRate),console.log(currentTime);let l=i(80);this.initialBufferSamples=1*l,this.partialBufferSamples=i(10),this.maxBufferSamples=i(10),this.partialBufferIncrement=i(5),this.maxPartialWithIncrements=i(80),this.maxBufferSamplesIncrement=i(5),this.maxMaxBufferWithIncrements=i(80),this.initState(),this.port.onmessage=a=>{if(a.data.type=="reset"){console.log("Reset audio processor state."),this.initState();return}let m=a.data.frame;if(this.frames.push(m),this.currentSamples()>=this.initialBufferSamples&&!this.started&&this.start(),this.pidx<20&&console.log(this.timestamp(),"Got packet",this.pidx++,r(this.currentSamples()),r(m.length)),this.currentSamples()>=this.totalMaxBufferSamples()){console.log(this.timestamp(),"Dropping packets",r(this.currentSamples()),r(this.totalMaxBufferSamples()));let h=this.initialBufferSamples+this.partialBufferSamples;for(;this.currentSamples()>this.initialBufferSamples+this.partialBufferSamples;){let e=this.frames[0],t=this.currentSamples()-h;t=Math.min(e.length-this.offsetInFirstBuffer,t),this.offsetInFirstBuffer+=t,this.timeInStream+=t/sampleRate,this.offsetInFirstBuffer==e.length&&(this.frames.shift(),this.offsetInFirstBuffer=0)}console.log(this.timestamp(),"Packet dropped",r(this.currentSamples())),this.maxBufferSamples+=this.maxBufferSamplesIncrement,this.maxBufferSamples=Math.min(this.maxMaxBufferWithIncrements,this.maxBufferSamples),console.log("Increased maxBuffer to",r(this.maxBufferSamples))}this.currentSamples()/sampleRate,this.port.postMessage({totalAudioPlayed:this.totalAudioPlayed,actualAudioPlayed:this.actualAudioPlayed,delay:a.data.micDuration-this.timeInStream,minDelay:this.minDelay,maxDelay:this.maxDelay})}}initState(){this.frames=new Array,this.offsetInFirstBuffer=0,this.firstOut=!1,this.remainingPartialBufferSamples=0,this.timeInStream=0,this.resetStart(),this.totalAudioPlayed=0,this.actualAudioPlayed=0,this.maxDelay=0,this.minDelay=2e3,this.pidx=0,this.partialBufferSamples=i(10),this.maxBufferSamples=i(10)}totalMaxBufferSamples(){return this.maxBufferSamples+this.partialBufferSamples+this.initialBufferSamples}timestamp(){return Date.now()%1e3}currentSamples(){let l=0;for(let a=0;a<this.frames.length;a++)l+=this.frames[a].length;return l-=this.offsetInFirstBuffer,l}resetStart(){this.started=!1}start(){this.started=!0,this.remainingPartialBufferSamples=this.partialBufferSamples,this.firstOut=!0}canPlay(){return this.started&&this.frames.length>0&&this.remainingPartialBufferSamples<=0}process(l,a,m){let h=this.currentSamples()/sampleRate;this.canPlay()&&(this.maxDelay=Math.max(this.maxDelay,h),this.minDelay=Math.min(this.minDelay,h));const e=a[0][0];if(!this.canPlay())return this.actualAudioPlayed>0&&(this.totalAudioPlayed+=e.length/sampleRate),this.remainingPartialBufferSamples-=e.length,!0;this.firstOut&&console.log(this.timestamp(),"Audio resumed",r(this.currentSamples()),this.remainingPartialBufferSamples),this.frames[0];let t=0;for(;t<e.length&&this.frames.length;){let s=this.frames[0],n=Math.min(s.length-this.offsetInFirstBuffer,e.length-t);e.set(s.subarray(this.offsetInFirstBuffer,this.offsetInFirstBuffer+n),t),this.offsetInFirstBuffer+=n,t+=n,this.offsetInFirstBuffer==s.length&&(this.offsetInFirstBuffer=0,this.frames.shift())}if(this.firstOut){this.firstOut=!1;for(let s=0;s<t;s++)e[s]*=s/t}if(t<e.length){console.log(this.timestamp(),"Missed some audio",e.length-t),this.partialBufferSamples+=this.partialBufferIncrement,this.partialBufferSamples=Math.min(this.partialBufferSamples,this.maxPartialWithIncrements),console.log("Increased partial buffer to",r(this.partialBufferSamples)),this.resetStart();for(let s=0;s<t;s++)e[s]*=(t-s)/t}return this.totalAudioPlayed+=e.length/sampleRate,this.actualAudioPlayed+=t/sampleRate,this.timeInStream+=t/sampleRate,!0}}registerProcessor("moshi-processor",u)})();
assets/canvas-logo-DG69PeuU.png ADDED
assets/decoderWorker.min-DI6rkCrP.js ADDED
@@ -0,0 +1 @@
 
 
1
+ (function(){"use strict";var e=typeof e<"u"?e:{};(function(t,r){typeof exports=="object"&&typeof module=="object"?module.exports=r():typeof define=="function"&&define.amd?define([],r):typeof exports=="object"?exports.DecoderWorker=r():t.DecoderWorker=r()})(typeof self<"u"?self:void 0,function(){return function(t){var r={};function n(i){if(r[i])return r[i].exports;var o=r[i]={i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=r,n.d=function(i,o,c){n.o(i,o)||Object.defineProperty(i,o,{enumerable:!0,get:c})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,o){if(1&o&&(i=n(i)),8&o||4&o&&typeof i=="object"&&i&&i.__esModule)return i;var c=Object.create(null);if(n.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:i}),2&o&&typeof i!="string")for(var f in i)n.d(c,f,function(a){return i[a]}.bind(null,f));return c},n.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(o,"a",o),o},n.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},n.p="",n(n.s=0)}([function(t,r,n){(function(i){var o,c,f=new Promise(function(s){c=s});i.onmessage=function(s){f.then(function(){switch(s.data.command){case"decode":o&&o.decode(s.data.pages);break;case"done":o&&(o.sendLastBuffer(),i.close());break;case"init":o=new a(s.data,e)}})};var a=function(s,u){if(!u)throw new Error("Module with exports required to initialize a decoder instance");this.mainReady=f,this.config=Object.assign({bufferLength:4096,decoderSampleRate:48e3,outputBufferSampleRate:48e3,resampleQuality:3},s),this._opus_decoder_create=u._opus_decoder_create,this._opus_decoder_destroy=u._opus_decoder_destroy,this._speex_resampler_process_interleaved_float=u._speex_resampler_process_interleaved_float,this._speex_resampler_init=u._speex_resampler_init,this._speex_resampler_destroy=u._speex_resampler_destroy,this._opus_decode_float=u._opus_decode_float,this._free=u._free,this._malloc=u._malloc,this.HEAPU8=u.HEAPU8,this.HEAP32=u.HEAP32,this.HEAPF32=u.HEAPF32,this.outputBuffers=[]};a.prototype.decode=function(s){var u=new DataView(s.buffer);this.getPageBoundaries(u).map(function(p){var _=u.getUint8(p+5,!0),B=u.getUint32(p+18,!0);if(2&_&&(this.numberOfChannels=u.getUint8(p+37,!0),this.init()),B>1){for(var M=u.getUint8(p+26,!0),T=p+27+M,j=0;j<M;j++){var D=u.getUint8(p+27+j,!0);if(this.decoderBuffer.set(s.subarray(T,T+=D),this.decoderBufferIndex),this.decoderBufferIndex+=D,D<255){var J=this._opus_decode_float(this.decoder,this.decoderBufferPointer,this.decoderBufferIndex,this.decoderOutputPointer,this.decoderOutputMaxLength,0),Z=Math.ceil(J*this.config.outputBufferSampleRate/this.config.decoderSampleRate);this.HEAP32[this.decoderOutputLengthPointer>>2]=J,this.HEAP32[this.resampleOutputLengthPointer>>2]=Z,this._speex_resampler_process_interleaved_float(this.resampler,this.decoderOutputPointer,this.decoderOutputLengthPointer,this.resampleOutputBufferPointer,this.resampleOutputLengthPointer),this.sendToOutputBuffers(this.HEAPF32.subarray(this.resampleOutputBufferPointer>>2,(this.resampleOutputBufferPointer>>2)+Z*this.numberOfChannels)),this.decoderBufferIndex=0}}4&_&&this.sendLastBuffer()}},this)},a.prototype.getPageBoundaries=function(s){for(var u=[],p=0;p<s.byteLength-4;p++)s.getUint32(p,!0)==1399285583&&u.push(p);return u},a.prototype.init=function(){this.resetOutputBuffers(),this.initCodec(),this.initResampler()},a.prototype.initCodec=function(){this.decoder&&(this._opus_decoder_destroy(this.decoder),this._free(this.decoderBufferPointer),this._free(this.decoderOutputLengthPointer),this._free(this.decoderOutputPointer));var s=this._malloc(4);this.decoder=this._opus_decoder_create(this.config.decoderSampleRate,this.numberOfChannels,s),this._free(s),this.decoderBufferMaxLength=4e3,this.decoderBufferPointer=this._malloc(this.decoderBufferMaxLength),this.decoderBuffer=this.HEAPU8.subarray(this.decoderBufferPointer,this.decoderBufferPointer+this.decoderBufferMaxLength),this.decoderBufferIndex=0,this.decoderOutputLengthPointer=this._malloc(4),this.decoderOutputMaxLength=this.config.decoderSampleRate*this.numberOfChannels*120/1e3,this.decoderOutputPointer=this._malloc(4*this.decoderOutputMaxLength)},a.prototype.initResampler=function(){this.resampler&&(this._speex_resampler_destroy(this.resampler),this._free(this.resampleOutputLengthPointer),this._free(this.resampleOutputBufferPointer));var s=this._malloc(4);this.resampler=this._speex_resampler_init(this.numberOfChannels,this.config.decoderSampleRate,this.config.outputBufferSampleRate,this.config.resampleQuality,s),this._free(s),this.resampleOutputLengthPointer=this._malloc(4),this.resampleOutputMaxLength=Math.ceil(this.decoderOutputMaxLength*this.config.outputBufferSampleRate/this.config.decoderSampleRate),this.resampleOutputBufferPointer=this._malloc(4*this.resampleOutputMaxLength)},a.prototype.resetOutputBuffers=function(){this.outputBuffers=[],this.outputBufferArrayBuffers=[],this.outputBufferIndex=0;for(var s=0;s<this.numberOfChannels;s++)this.outputBuffers.push(new Float32Array(this.config.bufferLength)),this.outputBufferArrayBuffers.push(this.outputBuffers[s].buffer)},a.prototype.sendLastBuffer=function(){this.sendToOutputBuffers(new Float32Array((this.config.bufferLength-this.outputBufferIndex)*this.numberOfChannels)),i.postMessage(null)},a.prototype.sendToOutputBuffers=function(s){for(var u=0,p=s.length/this.numberOfChannels;u<p;){var _=Math.min(p-u,this.config.bufferLength-this.outputBufferIndex);if(this.numberOfChannels===1)this.outputBuffers[0].set(s.subarray(u,u+_),this.outputBufferIndex);else for(var B=0;B<_;B++)this.outputBuffers.forEach(function(M,T){M[this.outputBufferIndex+B]=s[(u+B)*this.numberOfChannels+T]},this);u+=_,this.outputBufferIndex+=_,this.outputBufferIndex==this.config.bufferLength&&(i.postMessage(this.outputBuffers,this.outputBufferArrayBuffers),this.resetOutputBuffers())}},e||(e={}),e.mainReady=f,e.OggOpusDecoder=a,e.onRuntimeInitialized=c,t.exports=e}).call(this,n(1))},function(t,r){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch{typeof window=="object"&&(n=window)}t.exports=n}])});var O={},h;for(h in e)e.hasOwnProperty(h)&&(O[h]=e[h]);var W=typeof window=="object",w=typeof importScripts=="function",$=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",l="";function ee(t){return e.locateFile?e.locateFile(t,l):l+t}var U,S,I,y,g;$?(w?l=require("path").dirname(l)+"/":l=__dirname+"/",U=function(r,n){return y||(y=require("fs")),g||(g=require("path")),r=g.normalize(r),y.readFileSync(r,n?null:"utf8")},I=function(r){var n=U(r,!0);return n.buffer||(n=new Uint8Array(n)),re(n.buffer),n},S=function(r,n,i){y||(y=require("fs")),g||(g=require("path")),r=g.normalize(r),y.readFile(r,function(o,c){o?i(o):n(c.buffer)})},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),typeof module<"u"&&(module.exports=e),process.on("uncaughtException",function(t){if(!(t instanceof Re))throw t}),process.on("unhandledRejection",function(t){throw t}),e.inspect=function(){return"[Emscripten Module object]"}):(W||w)&&(w?l=self.location.href:typeof document<"u"&&document.currentScript&&(l=document.currentScript.src),l.indexOf("blob:")!==0?l=l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1):l="",U=function(t){var r=new XMLHttpRequest;return r.open("GET",t,!1),r.send(null),r.responseText},w&&(I=function(t){var r=new XMLHttpRequest;return r.open("GET",t,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),S=function(t,r,n){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(){if(i.status==200||i.status==0&&i.response){r(i.response);return}n()},i.onerror=n,i.send(null)});var te=e.print||console.log.bind(console),v=e.printErr||console.warn.bind(console);for(h in O)O.hasOwnProperty(h)&&(e[h]=O[h]);O=null,e.arguments&&e.arguments,e.thisProgram&&e.thisProgram,e.quit&&e.quit;var R;e.wasmBinary&&(R=e.wasmBinary),e.noExitRuntime,typeof WebAssembly!="object"&&b("no native wasm support detected");var N,q=!1;function re(t,r){t||b("Assertion failed: "+r)}var z=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function k(t,r,n){for(var i=r+n,o=r;t[o]&&!(o>=i);)++o;if(o-r>16&&t.subarray&&z)return z.decode(t.subarray(r,o));for(var c="";r<o;){var f=t[r++];if(!(f&128)){c+=String.fromCharCode(f);continue}var a=t[r++]&63;if((f&224)==192){c+=String.fromCharCode((f&31)<<6|a);continue}var s=t[r++]&63;if((f&240)==224?f=(f&15)<<12|a<<6|s:f=(f&7)<<18|a<<12|s<<6|t[r++]&63,f<65536)c+=String.fromCharCode(f);else{var u=f-65536;c+=String.fromCharCode(55296|u>>10,56320|u&1023)}}return c}function ne(t,r){return t?k(P,t,r):""}var P,A;function ie(t){e.HEAP8=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=A=new Int32Array(t),e.HEAPU8=P=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}e.INITIAL_MEMORY;var C,G=[],V=[],X=[];function oe(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)fe(e.preRun.shift());H(G)}function se(){H(V)}function ue(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)ce(e.postRun.shift());H(X)}function fe(t){G.unshift(t)}function ae(t){V.unshift(t)}function ce(t){X.unshift(t)}var m=0,x=null;function de(t){m++,e.monitorRunDependencies&&e.monitorRunDependencies(m)}function pe(t){if(m--,e.monitorRunDependencies&&e.monitorRunDependencies(m),m==0&&x){var r=x;x=null,r()}}e.preloadedImages={},e.preloadedAudios={};function b(t){e.onAbort&&e.onAbort(t),t="Aborted("+t+")",v(t),q=!0,t+=". Build with -s ASSERTIONS=1 for more info.";var r=new WebAssembly.RuntimeError(t);throw r}var le="data:application/octet-stream;base64,";function Q(t){return t.startsWith(le)}function Y(t){return t.startsWith("file://")}var d;d="decoderWorker.min.wasm",Q(d)||(d=ee(d));function K(t){try{if(t==d&&R)return new Uint8Array(R);if(I)return I(t);throw"both async and sync fetching of the wasm failed"}catch(r){b(r)}}function he(){if(!R&&(W||w)){if(typeof fetch=="function"&&!Y(d))return fetch(d,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw"failed to load wasm binary file at '"+d+"'";return t.arrayBuffer()}).catch(function(){return K(d)});if(S)return new Promise(function(t,r){S(d,function(n){t(new Uint8Array(n))},r)})}return Promise.resolve().then(function(){return K(d)})}function me(){var t={a:we};function r(f,a){var s=f.exports;e.asm=s,N=e.asm.g,ie(N.buffer),C=e.asm.q,ae(e.asm.h),pe()}de();function n(f){r(f.instance)}function i(f){return he().then(function(a){return WebAssembly.instantiate(a,t)}).then(function(a){return a}).then(f,function(a){v("failed to asynchronously prepare wasm: "+a),b(a)})}function o(){return!R&&typeof WebAssembly.instantiateStreaming=="function"&&!Q(d)&&!Y(d)&&typeof fetch=="function"?fetch(d,{credentials:"same-origin"}).then(function(f){var a=WebAssembly.instantiateStreaming(f,t);return a.then(n,function(s){return v("wasm streaming compile failed: "+s),v("falling back to ArrayBuffer instantiation"),i(n)})}):i(n)}if(e.instantiateWasm)try{var c=e.instantiateWasm(t,r);return c}catch(f){return v("Module.instantiateWasm callback failed with error: "+f),!1}return o(),{}}function H(t){for(;t.length>0;){var r=t.shift();if(typeof r=="function"){r(e);continue}var n=r.func;typeof n=="number"?r.arg===void 0?C.get(n)():C.get(n)(r.arg):n(r.arg===void 0?null:r.arg)}}function _e(){b("")}function ye(t,r,n){P.copyWithin(t,r,r+n)}function ge(t){b("OOM")}function ve(t){P.length,ge()}var E={mappings:{},buffers:[null,[],[]],printChar:function(t,r){var n=E.buffers[t];r===0||r===10?((t===1?te:v)(k(n,0)),n.length=0):n.push(r)},varargs:void 0,get:function(){E.varargs+=4;var t=A[E.varargs-4>>2];return t},getStr:function(t){var r=ne(t);return r},get64:function(t,r){return t}};function be(t){return 0}function Be(t,r,n,i,o){}function Oe(t,r,n,i){for(var o=0,c=0;c<n;c++){for(var f=A[r+c*8>>2],a=A[r+(c*8+4)>>2],s=0;s<a;s++)E.printChar(t,P[f+s]);o+=a}return A[i>>2]=o,0}var we={c:_e,e:ye,f:ve,d:be,b:Be,a:Oe};me(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.h).apply(null,arguments)},e._opus_decoder_create=function(){return(e._opus_decoder_create=e.asm.i).apply(null,arguments)},e._opus_decode_float=function(){return(e._opus_decode_float=e.asm.j).apply(null,arguments)},e._opus_decoder_destroy=function(){return(e._opus_decoder_destroy=e.asm.k).apply(null,arguments)},e._speex_resampler_init=function(){return(e._speex_resampler_init=e.asm.l).apply(null,arguments)},e._speex_resampler_destroy=function(){return(e._speex_resampler_destroy=e.asm.m).apply(null,arguments)},e._speex_resampler_process_interleaved_float=function(){return(e._speex_resampler_process_interleaved_float=e.asm.n).apply(null,arguments)},e._malloc=function(){return(e._malloc=e.asm.o).apply(null,arguments)},e._free=function(){return(e._free=e.asm.p).apply(null,arguments)};var L;function Re(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}x=function t(){L||F(),L||(x=t)};function F(t){if(m>0||(oe(),m>0))return;function r(){L||(L=!0,e.calledRun=!0,!q&&(se(),e.onRuntimeInitialized&&e.onRuntimeInitialized(),ue()))}e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),r()},1)):r()}if(e.run=F,e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();F()})();
assets/decoderWorker.min.js ADDED
@@ -0,0 +1,902 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var Module = typeof Module !== "undefined" ? Module : {};
2
+ !(function (e, t) {
3
+ "object" == typeof exports && "object" == typeof module
4
+ ? (module.exports = t())
5
+ : "function" == typeof define && define.amd
6
+ ? define([], t)
7
+ : "object" == typeof exports
8
+ ? (exports.DecoderWorker = t())
9
+ : (e.DecoderWorker = t());
10
+ })("undefined" != typeof self ? self : this, function () {
11
+ return (function (e) {
12
+ var t = {};
13
+ function r(s) {
14
+ if (t[s]) return t[s].exports;
15
+ var i = (t[s] = { i: s, l: !1, exports: {} });
16
+ return e[s].call(i.exports, i, i.exports, r), (i.l = !0), i.exports;
17
+ }
18
+ return (
19
+ (r.m = e),
20
+ (r.c = t),
21
+ (r.d = function (e, t, s) {
22
+ r.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: s });
23
+ }),
24
+ (r.r = function (e) {
25
+ "undefined" != typeof Symbol &&
26
+ Symbol.toStringTag &&
27
+ Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }),
28
+ Object.defineProperty(e, "__esModule", { value: !0 });
29
+ }),
30
+ (r.t = function (e, t) {
31
+ if ((1 & t && (e = r(e)), 8 & t)) return e;
32
+ if (4 & t && "object" == typeof e && e && e.__esModule) return e;
33
+ var s = Object.create(null);
34
+ if (
35
+ (r.r(s),
36
+ Object.defineProperty(s, "default", { enumerable: !0, value: e }),
37
+ 2 & t && "string" != typeof e)
38
+ )
39
+ for (var i in e)
40
+ r.d(
41
+ s,
42
+ i,
43
+ function (t) {
44
+ return e[t];
45
+ }.bind(null, i),
46
+ );
47
+ return s;
48
+ }),
49
+ (r.n = function (e) {
50
+ var t =
51
+ e && e.__esModule
52
+ ? function () {
53
+ return e.default;
54
+ }
55
+ : function () {
56
+ return e;
57
+ };
58
+ return r.d(t, "a", t), t;
59
+ }),
60
+ (r.o = function (e, t) {
61
+ return Object.prototype.hasOwnProperty.call(e, t);
62
+ }),
63
+ (r.p = ""),
64
+ r((r.s = 0))
65
+ );
66
+ })([
67
+ function (e, t, r) {
68
+ null;
69
+ (function (t) {
70
+ var r,
71
+ s,
72
+ i = new Promise(function (e) {
73
+ s = e;
74
+ });
75
+ t.onmessage = function (e) {
76
+ i.then(function () {
77
+ switch (e.data.command) {
78
+ case "decode":
79
+ r && r.decode(e.data.pages);
80
+ break;
81
+ case "done":
82
+ r && (r.sendLastBuffer(), t.close());
83
+ break;
84
+ case "init":
85
+ r = new o(e.data, Module);
86
+ }
87
+ });
88
+ };
89
+ var o = function (e, t) {
90
+ if (!t)
91
+ throw new Error(
92
+ "Module with exports required to initialize a decoder instance",
93
+ );
94
+ (this.mainReady = i),
95
+ (this.config = Object.assign(
96
+ {
97
+ bufferLength: 4096,
98
+ decoderSampleRate: 48e3,
99
+ outputBufferSampleRate: 48e3,
100
+ resampleQuality: 3,
101
+ },
102
+ e,
103
+ )),
104
+ (this._opus_decoder_create = t._opus_decoder_create),
105
+ (this._opus_decoder_destroy = t._opus_decoder_destroy),
106
+ (this._speex_resampler_process_interleaved_float =
107
+ t._speex_resampler_process_interleaved_float),
108
+ (this._speex_resampler_init = t._speex_resampler_init),
109
+ (this._speex_resampler_destroy = t._speex_resampler_destroy),
110
+ (this._opus_decode_float = t._opus_decode_float),
111
+ (this._free = t._free),
112
+ (this._malloc = t._malloc),
113
+ (this.HEAPU8 = t.HEAPU8),
114
+ (this.HEAP32 = t.HEAP32),
115
+ (this.HEAPF32 = t.HEAPF32),
116
+ (this.outputBuffers = []);
117
+ };
118
+ (o.prototype.decode = function (e) {
119
+ var t = new DataView(e.buffer);
120
+ this.getPageBoundaries(t).map(function (r) {
121
+ var s = t.getUint8(r + 5, !0),
122
+ i = t.getUint32(r + 18, !0);
123
+ if (
124
+ (2 & s &&
125
+ ((this.numberOfChannels = t.getUint8(r + 37, !0)), this.init()),
126
+ i > 1)
127
+ ) {
128
+ for (
129
+ var o = t.getUint8(r + 26, !0), u = r + 27 + o, n = 0;
130
+ n < o;
131
+ n++
132
+ ) {
133
+ var f = t.getUint8(r + 27 + n, !0);
134
+ if (
135
+ (this.decoderBuffer.set(
136
+ e.subarray(u, (u += f)),
137
+ this.decoderBufferIndex,
138
+ ),
139
+ (this.decoderBufferIndex += f),
140
+ f < 255)
141
+ ) {
142
+ var h = this._opus_decode_float(
143
+ this.decoder,
144
+ this.decoderBufferPointer,
145
+ this.decoderBufferIndex,
146
+ this.decoderOutputPointer,
147
+ this.decoderOutputMaxLength,
148
+ 0,
149
+ ),
150
+ a = Math.ceil(
151
+ (h * this.config.outputBufferSampleRate) /
152
+ this.config.decoderSampleRate,
153
+ );
154
+ (this.HEAP32[this.decoderOutputLengthPointer >> 2] = h),
155
+ (this.HEAP32[this.resampleOutputLengthPointer >> 2] = a),
156
+ this._speex_resampler_process_interleaved_float(
157
+ this.resampler,
158
+ this.decoderOutputPointer,
159
+ this.decoderOutputLengthPointer,
160
+ this.resampleOutputBufferPointer,
161
+ this.resampleOutputLengthPointer,
162
+ ),
163
+ this.sendToOutputBuffers(
164
+ this.HEAPF32.subarray(
165
+ this.resampleOutputBufferPointer >> 2,
166
+ (this.resampleOutputBufferPointer >> 2) +
167
+ a * this.numberOfChannels,
168
+ ),
169
+ ),
170
+ (this.decoderBufferIndex = 0);
171
+ }
172
+ }
173
+ 4 & s && this.sendLastBuffer();
174
+ }
175
+ }, this);
176
+ }),
177
+ (o.prototype.getPageBoundaries = function (e) {
178
+ for (var t = [], r = 0; r < e.byteLength - 4; r++)
179
+ 1399285583 == e.getUint32(r, !0) && t.push(r);
180
+ return t;
181
+ }),
182
+ (o.prototype.init = function () {
183
+ this.resetOutputBuffers(), this.initCodec(), this.initResampler();
184
+ }),
185
+ (o.prototype.initCodec = function () {
186
+ this.decoder &&
187
+ (this._opus_decoder_destroy(this.decoder),
188
+ this._free(this.decoderBufferPointer),
189
+ this._free(this.decoderOutputLengthPointer),
190
+ this._free(this.decoderOutputPointer));
191
+ var e = this._malloc(4);
192
+ (this.decoder = this._opus_decoder_create(
193
+ this.config.decoderSampleRate,
194
+ this.numberOfChannels,
195
+ e,
196
+ )),
197
+ this._free(e),
198
+ (this.decoderBufferMaxLength = 4e3),
199
+ (this.decoderBufferPointer = this._malloc(
200
+ this.decoderBufferMaxLength,
201
+ )),
202
+ (this.decoderBuffer = this.HEAPU8.subarray(
203
+ this.decoderBufferPointer,
204
+ this.decoderBufferPointer + this.decoderBufferMaxLength,
205
+ )),
206
+ (this.decoderBufferIndex = 0),
207
+ (this.decoderOutputLengthPointer = this._malloc(4)),
208
+ (this.decoderOutputMaxLength =
209
+ (this.config.decoderSampleRate * this.numberOfChannels * 120) /
210
+ 1e3),
211
+ (this.decoderOutputPointer = this._malloc(
212
+ 4 * this.decoderOutputMaxLength,
213
+ ));
214
+ }),
215
+ (o.prototype.initResampler = function () {
216
+ this.resampler &&
217
+ (this._speex_resampler_destroy(this.resampler),
218
+ this._free(this.resampleOutputLengthPointer),
219
+ this._free(this.resampleOutputBufferPointer));
220
+ var e = this._malloc(4);
221
+ (this.resampler = this._speex_resampler_init(
222
+ this.numberOfChannels,
223
+ this.config.decoderSampleRate,
224
+ this.config.outputBufferSampleRate,
225
+ this.config.resampleQuality,
226
+ e,
227
+ )),
228
+ this._free(e),
229
+ (this.resampleOutputLengthPointer = this._malloc(4)),
230
+ (this.resampleOutputMaxLength = Math.ceil(
231
+ (this.decoderOutputMaxLength *
232
+ this.config.outputBufferSampleRate) /
233
+ this.config.decoderSampleRate,
234
+ )),
235
+ (this.resampleOutputBufferPointer = this._malloc(
236
+ 4 * this.resampleOutputMaxLength,
237
+ ));
238
+ }),
239
+ (o.prototype.resetOutputBuffers = function () {
240
+ (this.outputBuffers = []),
241
+ (this.outputBufferArrayBuffers = []),
242
+ (this.outputBufferIndex = 0);
243
+ for (var e = 0; e < this.numberOfChannels; e++)
244
+ this.outputBuffers.push(
245
+ new Float32Array(this.config.bufferLength),
246
+ ),
247
+ this.outputBufferArrayBuffers.push(
248
+ this.outputBuffers[e].buffer,
249
+ );
250
+ }),
251
+ (o.prototype.sendLastBuffer = function () {
252
+ this.sendToOutputBuffers(
253
+ new Float32Array(
254
+ (this.config.bufferLength - this.outputBufferIndex) *
255
+ this.numberOfChannels,
256
+ ),
257
+ ),
258
+ t.postMessage(null);
259
+ }),
260
+ (o.prototype.sendToOutputBuffers = function (e) {
261
+ for (var r = 0, s = e.length / this.numberOfChannels; r < s; ) {
262
+ var i = Math.min(
263
+ s - r,
264
+ this.config.bufferLength - this.outputBufferIndex,
265
+ );
266
+ if (1 === this.numberOfChannels)
267
+ this.outputBuffers[0].set(
268
+ e.subarray(r, r + i),
269
+ this.outputBufferIndex,
270
+ );
271
+ else
272
+ for (var o = 0; o < i; o++)
273
+ this.outputBuffers.forEach(function (t, s) {
274
+ t[this.outputBufferIndex + o] =
275
+ e[(r + o) * this.numberOfChannels + s];
276
+ }, this);
277
+ (r += i),
278
+ (this.outputBufferIndex += i),
279
+ this.outputBufferIndex == this.config.bufferLength &&
280
+ (t.postMessage(
281
+ this.outputBuffers,
282
+ this.outputBufferArrayBuffers,
283
+ ),
284
+ this.resetOutputBuffers());
285
+ }
286
+ }),
287
+ Module || (Module = {}),
288
+ (Module.mainReady = i),
289
+ (Module.OggOpusDecoder = o),
290
+ (Module.onRuntimeInitialized = s),
291
+ (e.exports = Module);
292
+ }).call(this, r(1));
293
+ },
294
+ function (e, t) {
295
+ var r;
296
+ r = (function () {
297
+ return this;
298
+ })();
299
+ try {
300
+ r = r || new Function("return this")();
301
+ } catch (e) {
302
+ "object" == typeof window && (r = window);
303
+ }
304
+ e.exports = r;
305
+ },
306
+ ]);
307
+ });
308
+ var moduleOverrides = {};
309
+ var key;
310
+ for (key in Module) {
311
+ if (Module.hasOwnProperty(key)) {
312
+ moduleOverrides[key] = Module[key];
313
+ }
314
+ }
315
+ var arguments_ = [];
316
+ var thisProgram = "./this.program";
317
+ var quit_ = function (status, toThrow) {
318
+ throw toThrow;
319
+ };
320
+ var ENVIRONMENT_IS_WEB = typeof window === "object";
321
+ var ENVIRONMENT_IS_WORKER = typeof importScripts === "function";
322
+ var ENVIRONMENT_IS_NODE =
323
+ typeof process === "object" &&
324
+ typeof process.versions === "object" &&
325
+ typeof process.versions.node === "string";
326
+ var scriptDirectory = "";
327
+ function locateFile(path) {
328
+ if (Module["locateFile"]) {
329
+ return Module["locateFile"](path, scriptDirectory);
330
+ }
331
+ return scriptDirectory + path;
332
+ }
333
+ var read_, readAsync, readBinary, setWindowTitle;
334
+ function logExceptionOnExit(e) {
335
+ if (e instanceof ExitStatus) return;
336
+ var toLog = e;
337
+ err("exiting due to exception: " + toLog);
338
+ }
339
+ var nodeFS;
340
+ var nodePath;
341
+ if (ENVIRONMENT_IS_NODE) {
342
+ if (ENVIRONMENT_IS_WORKER) {
343
+ scriptDirectory = require("path").dirname(scriptDirectory) + "/";
344
+ } else {
345
+ scriptDirectory = __dirname + "/";
346
+ }
347
+ read_ = function shell_read(filename, binary) {
348
+ if (!nodeFS) nodeFS = require("fs");
349
+ if (!nodePath) nodePath = require("path");
350
+ filename = nodePath["normalize"](filename);
351
+ return nodeFS["readFileSync"](filename, binary ? null : "utf8");
352
+ };
353
+ readBinary = function readBinary(filename) {
354
+ var ret = read_(filename, true);
355
+ if (!ret.buffer) {
356
+ ret = new Uint8Array(ret);
357
+ }
358
+ assert(ret.buffer);
359
+ return ret;
360
+ };
361
+ readAsync = function readAsync(filename, onload, onerror) {
362
+ if (!nodeFS) nodeFS = require("fs");
363
+ if (!nodePath) nodePath = require("path");
364
+ filename = nodePath["normalize"](filename);
365
+ nodeFS["readFile"](filename, function (err, data) {
366
+ if (err) onerror(err);
367
+ else onload(data.buffer);
368
+ });
369
+ };
370
+ if (process["argv"].length > 1) {
371
+ thisProgram = process["argv"][1].replace(/\\/g, "/");
372
+ }
373
+ arguments_ = process["argv"].slice(2);
374
+ if (typeof module !== "undefined") {
375
+ module["exports"] = Module;
376
+ }
377
+ process["on"]("uncaughtException", function (ex) {
378
+ if (!(ex instanceof ExitStatus)) {
379
+ throw ex;
380
+ }
381
+ });
382
+ process["on"]("unhandledRejection", function (reason) {
383
+ throw reason;
384
+ });
385
+ quit_ = function (status, toThrow) {
386
+ if (keepRuntimeAlive()) {
387
+ process["exitCode"] = status;
388
+ throw toThrow;
389
+ }
390
+ logExceptionOnExit(toThrow);
391
+ process["exit"](status);
392
+ };
393
+ Module["inspect"] = function () {
394
+ return "[Emscripten Module object]";
395
+ };
396
+ } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
397
+ if (ENVIRONMENT_IS_WORKER) {
398
+ scriptDirectory = self.location.href;
399
+ } else if (typeof document !== "undefined" && document.currentScript) {
400
+ scriptDirectory = document.currentScript.src;
401
+ }
402
+ if (scriptDirectory.indexOf("blob:") !== 0) {
403
+ scriptDirectory = scriptDirectory.substr(
404
+ 0,
405
+ scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1,
406
+ );
407
+ } else {
408
+ scriptDirectory = "";
409
+ }
410
+ {
411
+ read_ = function (url) {
412
+ var xhr = new XMLHttpRequest();
413
+ xhr.open("GET", url, false);
414
+ xhr.send(null);
415
+ return xhr.responseText;
416
+ };
417
+ if (ENVIRONMENT_IS_WORKER) {
418
+ readBinary = function (url) {
419
+ var xhr = new XMLHttpRequest();
420
+ xhr.open("GET", url, false);
421
+ xhr.responseType = "arraybuffer";
422
+ xhr.send(null);
423
+ return new Uint8Array(xhr.response);
424
+ };
425
+ }
426
+ readAsync = function (url, onload, onerror) {
427
+ var xhr = new XMLHttpRequest();
428
+ xhr.open("GET", url, true);
429
+ xhr.responseType = "arraybuffer";
430
+ xhr.onload = function () {
431
+ if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) {
432
+ onload(xhr.response);
433
+ return;
434
+ }
435
+ onerror();
436
+ };
437
+ xhr.onerror = onerror;
438
+ xhr.send(null);
439
+ };
440
+ }
441
+ setWindowTitle = function (title) {
442
+ document.title = title;
443
+ };
444
+ } else {
445
+ }
446
+ var out = Module["print"] || console.log.bind(console);
447
+ var err = Module["printErr"] || console.warn.bind(console);
448
+ for (key in moduleOverrides) {
449
+ if (moduleOverrides.hasOwnProperty(key)) {
450
+ Module[key] = moduleOverrides[key];
451
+ }
452
+ }
453
+ moduleOverrides = null;
454
+ if (Module["arguments"]) arguments_ = Module["arguments"];
455
+ if (Module["thisProgram"]) thisProgram = Module["thisProgram"];
456
+ if (Module["quit"]) quit_ = Module["quit"];
457
+ var wasmBinary;
458
+ if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"];
459
+ var noExitRuntime = Module["noExitRuntime"] || true;
460
+ if (typeof WebAssembly !== "object") {
461
+ abort("no native wasm support detected");
462
+ }
463
+ var wasmMemory;
464
+ var ABORT = false;
465
+ var EXITSTATUS;
466
+ function assert(condition, text) {
467
+ if (!condition) {
468
+ abort("Assertion failed: " + text);
469
+ }
470
+ }
471
+ var UTF8Decoder =
472
+ typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : undefined;
473
+ function UTF8ArrayToString(heap, idx, maxBytesToRead) {
474
+ var endIdx = idx + maxBytesToRead;
475
+ var endPtr = idx;
476
+ while (heap[endPtr] && !(endPtr >= endIdx)) ++endPtr;
477
+ if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) {
478
+ return UTF8Decoder.decode(heap.subarray(idx, endPtr));
479
+ } else {
480
+ var str = "";
481
+ while (idx < endPtr) {
482
+ var u0 = heap[idx++];
483
+ if (!(u0 & 128)) {
484
+ str += String.fromCharCode(u0);
485
+ continue;
486
+ }
487
+ var u1 = heap[idx++] & 63;
488
+ if ((u0 & 224) == 192) {
489
+ str += String.fromCharCode(((u0 & 31) << 6) | u1);
490
+ continue;
491
+ }
492
+ var u2 = heap[idx++] & 63;
493
+ if ((u0 & 240) == 224) {
494
+ u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;
495
+ } else {
496
+ u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heap[idx++] & 63);
497
+ }
498
+ if (u0 < 65536) {
499
+ str += String.fromCharCode(u0);
500
+ } else {
501
+ var ch = u0 - 65536;
502
+ str += String.fromCharCode(55296 | (ch >> 10), 56320 | (ch & 1023));
503
+ }
504
+ }
505
+ }
506
+ return str;
507
+ }
508
+ function UTF8ToString(ptr, maxBytesToRead) {
509
+ return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
510
+ }
511
+ var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
512
+ function updateGlobalBufferAndViews(buf) {
513
+ buffer = buf;
514
+ Module["HEAP8"] = HEAP8 = new Int8Array(buf);
515
+ Module["HEAP16"] = HEAP16 = new Int16Array(buf);
516
+ Module["HEAP32"] = HEAP32 = new Int32Array(buf);
517
+ Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf);
518
+ Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf);
519
+ Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf);
520
+ Module["HEAPF32"] = HEAPF32 = new Float32Array(buf);
521
+ Module["HEAPF64"] = HEAPF64 = new Float64Array(buf);
522
+ }
523
+ var INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216;
524
+ var wasmTable;
525
+ var __ATPRERUN__ = [];
526
+ var __ATINIT__ = [];
527
+ var __ATPOSTRUN__ = [];
528
+ var runtimeInitialized = false;
529
+ var runtimeKeepaliveCounter = 0;
530
+ function keepRuntimeAlive() {
531
+ return noExitRuntime || runtimeKeepaliveCounter > 0;
532
+ }
533
+ function preRun() {
534
+ if (Module["preRun"]) {
535
+ if (typeof Module["preRun"] == "function")
536
+ Module["preRun"] = [Module["preRun"]];
537
+ while (Module["preRun"].length) {
538
+ addOnPreRun(Module["preRun"].shift());
539
+ }
540
+ }
541
+ callRuntimeCallbacks(__ATPRERUN__);
542
+ }
543
+ function initRuntime() {
544
+ runtimeInitialized = true;
545
+ callRuntimeCallbacks(__ATINIT__);
546
+ }
547
+ function postRun() {
548
+ if (Module["postRun"]) {
549
+ if (typeof Module["postRun"] == "function")
550
+ Module["postRun"] = [Module["postRun"]];
551
+ while (Module["postRun"].length) {
552
+ addOnPostRun(Module["postRun"].shift());
553
+ }
554
+ }
555
+ callRuntimeCallbacks(__ATPOSTRUN__);
556
+ }
557
+ function addOnPreRun(cb) {
558
+ __ATPRERUN__.unshift(cb);
559
+ }
560
+ function addOnInit(cb) {
561
+ __ATINIT__.unshift(cb);
562
+ }
563
+ function addOnPostRun(cb) {
564
+ __ATPOSTRUN__.unshift(cb);
565
+ }
566
+ var runDependencies = 0;
567
+ var runDependencyWatcher = null;
568
+ var dependenciesFulfilled = null;
569
+ function addRunDependency(id) {
570
+ runDependencies++;
571
+ if (Module["monitorRunDependencies"]) {
572
+ Module["monitorRunDependencies"](runDependencies);
573
+ }
574
+ }
575
+ function removeRunDependency(id) {
576
+ runDependencies--;
577
+ if (Module["monitorRunDependencies"]) {
578
+ Module["monitorRunDependencies"](runDependencies);
579
+ }
580
+ if (runDependencies == 0) {
581
+ if (runDependencyWatcher !== null) {
582
+ clearInterval(runDependencyWatcher);
583
+ runDependencyWatcher = null;
584
+ }
585
+ if (dependenciesFulfilled) {
586
+ var callback = dependenciesFulfilled;
587
+ dependenciesFulfilled = null;
588
+ callback();
589
+ }
590
+ }
591
+ }
592
+ Module["preloadedImages"] = {};
593
+ Module["preloadedAudios"] = {};
594
+ function abort(what) {
595
+ {
596
+ if (Module["onAbort"]) {
597
+ Module["onAbort"](what);
598
+ }
599
+ }
600
+ what = "Aborted(" + what + ")";
601
+ err(what);
602
+ ABORT = true;
603
+ EXITSTATUS = 1;
604
+ what += ". Build with -s ASSERTIONS=1 for more info.";
605
+ var e = new WebAssembly.RuntimeError(what);
606
+ throw e;
607
+ }
608
+ var dataURIPrefix = "data:application/octet-stream;base64,";
609
+ function isDataURI(filename) {
610
+ return filename.startsWith(dataURIPrefix);
611
+ }
612
+ function isFileURI(filename) {
613
+ return filename.startsWith("file://");
614
+ }
615
+ var wasmBinaryFile;
616
+ wasmBinaryFile = "decoderWorker.min.wasm";
617
+ if (!isDataURI(wasmBinaryFile)) {
618
+ wasmBinaryFile = locateFile(wasmBinaryFile);
619
+ }
620
+ function getBinary(file) {
621
+ try {
622
+ if (file == wasmBinaryFile && wasmBinary) {
623
+ return new Uint8Array(wasmBinary);
624
+ }
625
+ if (readBinary) {
626
+ return readBinary(file);
627
+ } else {
628
+ throw "both async and sync fetching of the wasm failed";
629
+ }
630
+ } catch (err) {
631
+ abort(err);
632
+ }
633
+ }
634
+ function getBinaryPromise() {
635
+ if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {
636
+ if (typeof fetch === "function" && !isFileURI(wasmBinaryFile)) {
637
+ return fetch(wasmBinaryFile, { credentials: "same-origin" })
638
+ .then(function (response) {
639
+ if (!response["ok"]) {
640
+ throw "failed to load wasm binary file at '" + wasmBinaryFile + "'";
641
+ }
642
+ return response["arrayBuffer"]();
643
+ })
644
+ .catch(function () {
645
+ return getBinary(wasmBinaryFile);
646
+ });
647
+ } else {
648
+ if (readAsync) {
649
+ return new Promise(function (resolve, reject) {
650
+ readAsync(
651
+ wasmBinaryFile,
652
+ function (response) {
653
+ resolve(new Uint8Array(response));
654
+ },
655
+ reject,
656
+ );
657
+ });
658
+ }
659
+ }
660
+ }
661
+ return Promise.resolve().then(function () {
662
+ return getBinary(wasmBinaryFile);
663
+ });
664
+ }
665
+ function createWasm() {
666
+ var info = { a: asmLibraryArg };
667
+ function receiveInstance(instance, module) {
668
+ var exports = instance.exports;
669
+ Module["asm"] = exports;
670
+ wasmMemory = Module["asm"]["g"];
671
+ updateGlobalBufferAndViews(wasmMemory.buffer);
672
+ wasmTable = Module["asm"]["q"];
673
+ addOnInit(Module["asm"]["h"]);
674
+ removeRunDependency("wasm-instantiate");
675
+ }
676
+ addRunDependency("wasm-instantiate");
677
+ function receiveInstantiationResult(result) {
678
+ receiveInstance(result["instance"]);
679
+ }
680
+ function instantiateArrayBuffer(receiver) {
681
+ return getBinaryPromise()
682
+ .then(function (binary) {
683
+ return WebAssembly.instantiate(binary, info);
684
+ })
685
+ .then(function (instance) {
686
+ return instance;
687
+ })
688
+ .then(receiver, function (reason) {
689
+ err("failed to asynchronously prepare wasm: " + reason);
690
+ abort(reason);
691
+ });
692
+ }
693
+ function instantiateAsync() {
694
+ if (
695
+ !wasmBinary &&
696
+ typeof WebAssembly.instantiateStreaming === "function" &&
697
+ !isDataURI(wasmBinaryFile) &&
698
+ !isFileURI(wasmBinaryFile) &&
699
+ typeof fetch === "function"
700
+ ) {
701
+ return fetch(wasmBinaryFile, { credentials: "same-origin" }).then(
702
+ function (response) {
703
+ var result = WebAssembly.instantiateStreaming(response, info);
704
+ return result.then(receiveInstantiationResult, function (reason) {
705
+ err("wasm streaming compile failed: " + reason);
706
+ err("falling back to ArrayBuffer instantiation");
707
+ return instantiateArrayBuffer(receiveInstantiationResult);
708
+ });
709
+ },
710
+ );
711
+ } else {
712
+ return instantiateArrayBuffer(receiveInstantiationResult);
713
+ }
714
+ }
715
+ if (Module["instantiateWasm"]) {
716
+ try {
717
+ var exports = Module["instantiateWasm"](info, receiveInstance);
718
+ return exports;
719
+ } catch (e) {
720
+ err("Module.instantiateWasm callback failed with error: " + e);
721
+ return false;
722
+ }
723
+ }
724
+ instantiateAsync();
725
+ return {};
726
+ }
727
+ function callRuntimeCallbacks(callbacks) {
728
+ while (callbacks.length > 0) {
729
+ var callback = callbacks.shift();
730
+ if (typeof callback == "function") {
731
+ callback(Module);
732
+ continue;
733
+ }
734
+ var func = callback.func;
735
+ if (typeof func === "number") {
736
+ if (callback.arg === undefined) {
737
+ wasmTable.get(func)();
738
+ } else {
739
+ wasmTable.get(func)(callback.arg);
740
+ }
741
+ } else {
742
+ func(callback.arg === undefined ? null : callback.arg);
743
+ }
744
+ }
745
+ }
746
+ function _abort() {
747
+ abort("");
748
+ }
749
+ function _emscripten_memcpy_big(dest, src, num) {
750
+ HEAPU8.copyWithin(dest, src, src + num);
751
+ }
752
+ function abortOnCannotGrowMemory(requestedSize) {
753
+ abort("OOM");
754
+ }
755
+ function _emscripten_resize_heap(requestedSize) {
756
+ var oldSize = HEAPU8.length;
757
+ requestedSize = requestedSize >>> 0;
758
+ abortOnCannotGrowMemory(requestedSize);
759
+ }
760
+ var SYSCALLS = {
761
+ mappings: {},
762
+ buffers: [null, [], []],
763
+ printChar: function (stream, curr) {
764
+ var buffer = SYSCALLS.buffers[stream];
765
+ if (curr === 0 || curr === 10) {
766
+ (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0));
767
+ buffer.length = 0;
768
+ } else {
769
+ buffer.push(curr);
770
+ }
771
+ },
772
+ varargs: undefined,
773
+ get: function () {
774
+ SYSCALLS.varargs += 4;
775
+ var ret = HEAP32[(SYSCALLS.varargs - 4) >> 2];
776
+ return ret;
777
+ },
778
+ getStr: function (ptr) {
779
+ var ret = UTF8ToString(ptr);
780
+ return ret;
781
+ },
782
+ get64: function (low, high) {
783
+ return low;
784
+ },
785
+ };
786
+ function _fd_close(fd) {
787
+ return 0;
788
+ }
789
+ function _fd_seek(fd, offset_low, offset_high, whence, newOffset) {}
790
+ function _fd_write(fd, iov, iovcnt, pnum) {
791
+ var num = 0;
792
+ for (var i = 0; i < iovcnt; i++) {
793
+ var ptr = HEAP32[(iov + i * 8) >> 2];
794
+ var len = HEAP32[(iov + (i * 8 + 4)) >> 2];
795
+ for (var j = 0; j < len; j++) {
796
+ SYSCALLS.printChar(fd, HEAPU8[ptr + j]);
797
+ }
798
+ num += len;
799
+ }
800
+ HEAP32[pnum >> 2] = num;
801
+ return 0;
802
+ }
803
+ var asmLibraryArg = {
804
+ c: _abort,
805
+ e: _emscripten_memcpy_big,
806
+ f: _emscripten_resize_heap,
807
+ d: _fd_close,
808
+ b: _fd_seek,
809
+ a: _fd_write,
810
+ };
811
+ var asm = createWasm();
812
+ var ___wasm_call_ctors = (Module["___wasm_call_ctors"] = function () {
813
+ return (___wasm_call_ctors = Module["___wasm_call_ctors"] =
814
+ Module["asm"]["h"]).apply(null, arguments);
815
+ });
816
+ var _opus_decoder_create = (Module["_opus_decoder_create"] = function () {
817
+ return (_opus_decoder_create = Module["_opus_decoder_create"] =
818
+ Module["asm"]["i"]).apply(null, arguments);
819
+ });
820
+ var _opus_decode_float = (Module["_opus_decode_float"] = function () {
821
+ return (_opus_decode_float = Module["_opus_decode_float"] =
822
+ Module["asm"]["j"]).apply(null, arguments);
823
+ });
824
+ var _opus_decoder_destroy = (Module["_opus_decoder_destroy"] = function () {
825
+ return (_opus_decoder_destroy = Module["_opus_decoder_destroy"] =
826
+ Module["asm"]["k"]).apply(null, arguments);
827
+ });
828
+ var _speex_resampler_init = (Module["_speex_resampler_init"] = function () {
829
+ return (_speex_resampler_init = Module["_speex_resampler_init"] =
830
+ Module["asm"]["l"]).apply(null, arguments);
831
+ });
832
+ var _speex_resampler_destroy = (Module["_speex_resampler_destroy"] =
833
+ function () {
834
+ return (_speex_resampler_destroy = Module["_speex_resampler_destroy"] =
835
+ Module["asm"]["m"]).apply(null, arguments);
836
+ });
837
+ var _speex_resampler_process_interleaved_float = (Module[
838
+ "_speex_resampler_process_interleaved_float"
839
+ ] = function () {
840
+ return (_speex_resampler_process_interleaved_float = Module[
841
+ "_speex_resampler_process_interleaved_float"
842
+ ] =
843
+ Module["asm"]["n"]).apply(null, arguments);
844
+ });
845
+ var _malloc = (Module["_malloc"] = function () {
846
+ return (_malloc = Module["_malloc"] = Module["asm"]["o"]).apply(
847
+ null,
848
+ arguments,
849
+ );
850
+ });
851
+ var _free = (Module["_free"] = function () {
852
+ return (_free = Module["_free"] = Module["asm"]["p"]).apply(null, arguments);
853
+ });
854
+ var calledRun;
855
+ function ExitStatus(status) {
856
+ this.name = "ExitStatus";
857
+ this.message = "Program terminated with exit(" + status + ")";
858
+ this.status = status;
859
+ }
860
+ dependenciesFulfilled = function runCaller() {
861
+ if (!calledRun) run();
862
+ if (!calledRun) dependenciesFulfilled = runCaller;
863
+ };
864
+ function run(args) {
865
+ args = args || arguments_;
866
+ if (runDependencies > 0) {
867
+ return;
868
+ }
869
+ preRun();
870
+ if (runDependencies > 0) {
871
+ return;
872
+ }
873
+ function doRun() {
874
+ if (calledRun) return;
875
+ calledRun = true;
876
+ Module["calledRun"] = true;
877
+ if (ABORT) return;
878
+ initRuntime();
879
+ if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"]();
880
+ postRun();
881
+ }
882
+ if (Module["setStatus"]) {
883
+ Module["setStatus"]("Running...");
884
+ setTimeout(function () {
885
+ setTimeout(function () {
886
+ Module["setStatus"]("");
887
+ }, 1);
888
+ doRun();
889
+ }, 1);
890
+ } else {
891
+ doRun();
892
+ }
893
+ }
894
+ Module["run"] = run;
895
+ if (Module["preInit"]) {
896
+ if (typeof Module["preInit"] == "function")
897
+ Module["preInit"] = [Module["preInit"]];
898
+ while (Module["preInit"].length > 0) {
899
+ Module["preInit"].pop()();
900
+ }
901
+ }
902
+ run();
assets/decoderWorker.min.wasm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd1d29c43b3fa05719c3d024ed9b9f1528be92415bd6d39d413b262a61d1891f
3
+ size 149534
assets/encoderWorker.min-DpsJ02BN.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/index-CBBdtRXe.css ADDED
@@ -0,0 +1 @@
 
 
1
+ *,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root,[data-theme]{background-color:var(--fallback-b1,oklch(var(--b1)/1));color:var(--fallback-bc,oklch(var(--bc)/1))}@supports not (color: oklch(0% 0 0)){:root{color-scheme:light;--fallback-p: #491eff;--fallback-pc: #d4dbff;--fallback-s: #ff41c7;--fallback-sc: #fff9fc;--fallback-a: #00cfbd;--fallback-ac: #00100d;--fallback-n: #2b3440;--fallback-nc: #d7dde4;--fallback-b1: #ffffff;--fallback-b2: #e5e6e6;--fallback-b3: #e5e6e6;--fallback-bc: #1f2937;--fallback-in: #00b3f0;--fallback-inc: #000000;--fallback-su: #00ca92;--fallback-suc: #000000;--fallback-wa: #ffc22d;--fallback-wac: #000000;--fallback-er: #ff6f70;--fallback-erc: #000000}@media (prefers-color-scheme: dark){:root{color-scheme:dark;--fallback-p: #7582ff;--fallback-pc: #050617;--fallback-s: #ff71cf;--fallback-sc: #190211;--fallback-a: #00c7b5;--fallback-ac: #000e0c;--fallback-n: #2a323c;--fallback-nc: #a6adbb;--fallback-b1: #1d232a;--fallback-b2: #191e24;--fallback-b3: #15191e;--fallback-bc: #a6adbb;--fallback-in: #00b3f0;--fallback-inc: #000000;--fallback-su: #00ca92;--fallback-suc: #000000;--fallback-wa: #ffc22d;--fallback-wac: #000000;--fallback-er: #ff6f70;--fallback-erc: #000000}}}html{-webkit-tap-highlight-color:transparent}*{scrollbar-color:currentColor transparent}:root{color-scheme:light;--in: 72.06% .191 231.6;--su: 64.8% .15 160;--wa: 84.71% .199 83.87;--er: 71.76% .221 22.18;--pc: 89.824% .06192 275.75;--ac: 15.352% .0368 183.61;--inc: 0% 0 0;--suc: 0% 0 0;--wac: 0% 0 0;--erc: 0% 0 0;--rounded-box: 1rem;--rounded-btn: .5rem;--rounded-badge: 1.9rem;--animation-btn: .25s;--animation-input: .2s;--btn-focus-scale: .95;--border-btn: 1px;--tab-border: 1px;--tab-radius: .5rem;--p: 49.12% .3096 275.75;--s: 69.71% .329 342.55;--sc: 98.71% .0106 342.55;--a: 76.76% .184 183.61;--n: 32.1785% .02476 255.701624;--nc: 89.4994% .011585 252.096176;--b1: 100% 0 0;--b2: 96.1151% 0 0;--b3: 92.4169% .00108 197.137559;--bc: 27.8078% .029596 256.847952}@media (prefers-color-scheme: dark){:root{color-scheme:dark;--in: 72.06% .191 231.6;--su: 64.8% .15 160;--wa: 84.71% .199 83.87;--er: 71.76% .221 22.18;--pc: 13.138% .0392 275.75;--sc: 14.96% .052 342.55;--ac: 14.902% .0334 183.61;--inc: 0% 0 0;--suc: 0% 0 0;--wac: 0% 0 0;--erc: 0% 0 0;--rounded-box: 1rem;--rounded-btn: .5rem;--rounded-badge: 1.9rem;--animation-btn: .25s;--animation-input: .2s;--btn-focus-scale: .95;--border-btn: 1px;--tab-border: 1px;--tab-radius: .5rem;--p: 65.69% .196 275.75;--s: 74.8% .26 342.55;--a: 74.51% .167 183.61;--n: 31.3815% .021108 254.139175;--nc: 74.6477% .0216 264.435964;--b1: 25.3267% .015896 252.417568;--b2: 23.2607% .013807 253.100675;--b3: 21.1484% .01165 254.087939;--bc: 74.6477% .0216 264.435964}}[data-theme=light]{color-scheme:light;--in: 72.06% .191 231.6;--su: 64.8% .15 160;--wa: 84.71% .199 83.87;--er: 71.76% .221 22.18;--pc: 89.824% .06192 275.75;--ac: 15.352% .0368 183.61;--inc: 0% 0 0;--suc: 0% 0 0;--wac: 0% 0 0;--erc: 0% 0 0;--rounded-box: 1rem;--rounded-btn: .5rem;--rounded-badge: 1.9rem;--animation-btn: .25s;--animation-input: .2s;--btn-focus-scale: .95;--border-btn: 1px;--tab-border: 1px;--tab-radius: .5rem;--p: 49.12% .3096 275.75;--s: 69.71% .329 342.55;--sc: 98.71% .0106 342.55;--a: 76.76% .184 183.61;--n: 32.1785% .02476 255.701624;--nc: 89.4994% .011585 252.096176;--b1: 100% 0 0;--b2: 96.1151% 0 0;--b3: 92.4169% .00108 197.137559;--bc: 27.8078% .029596 256.847952}[data-theme=dark]{color-scheme:dark;--in: 72.06% .191 231.6;--su: 64.8% .15 160;--wa: 84.71% .199 83.87;--er: 71.76% .221 22.18;--pc: 13.138% .0392 275.75;--sc: 14.96% .052 342.55;--ac: 14.902% .0334 183.61;--inc: 0% 0 0;--suc: 0% 0 0;--wac: 0% 0 0;--erc: 0% 0 0;--rounded-box: 1rem;--rounded-btn: .5rem;--rounded-badge: 1.9rem;--animation-btn: .25s;--animation-input: .2s;--btn-focus-scale: .95;--border-btn: 1px;--tab-border: 1px;--tab-radius: .5rem;--p: 65.69% .196 275.75;--s: 74.8% .26 342.55;--a: 74.51% .167 183.61;--n: 31.3815% .021108 254.139175;--nc: 74.6477% .0216 264.435964;--b1: 25.3267% .015896 252.417568;--b2: 23.2607% .013807 253.100675;--b3: 21.1484% .01165 254.087939;--bc: 74.6477% .0216 264.435964}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }@media (hover:hover){.table tr.hover:hover,.table tr.hover:nth-child(2n):hover{--tw-bg-opacity: 1;background-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)))}}.chat{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));-moz-column-gap:.75rem;column-gap:.75rem;padding-top:.25rem;padding-bottom:.25rem}@media (hover: hover){.btm-nav>*.disabled:hover,.btm-nav>*[disabled]:hover{pointer-events:none;--tw-border-opacity: 0;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));--tw-bg-opacity: .1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-text-opacity: .2}}.input{flex-shrink:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:3rem;padding-left:1rem;padding-right:1rem;font-size:1rem;line-height:2;line-height:1.5rem;border-radius:var(--rounded-btn, .5rem);border-width:1px;border-color:transparent;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)))}.input[type=number]::-webkit-inner-spin-button,.input-md[type=number]::-webkit-inner-spin-button{margin-top:-1rem;margin-bottom:-1rem;margin-inline-end:-1rem}.menu li.disabled{cursor:not-allowed;-webkit-user-select:none;-moz-user-select:none;user-select:none;color:var(--fallback-bc,oklch(var(--bc)/.3))}.modal{pointer-events:none;position:fixed;top:0;right:0;bottom:0;left:0;margin:0;display:grid;height:100%;max-height:none;width:100%;max-width:none;justify-items:center;padding:0;opacity:0;overscroll-behavior:contain;z-index:999;background-color:transparent;color:inherit;transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1);transition-property:transform,opacity,visibility;overflow-y:hidden}:where(.modal){align-items:center}.modal-box{max-height:calc(100vh - 5em);grid-column-start:1;grid-row-start:1;width:91.666667%;max-width:32rem;--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-bottom-right-radius:var(--rounded-box, 1rem);border-bottom-left-radius:var(--rounded-box, 1rem);border-top-left-radius:var(--rounded-box, 1rem);border-top-right-radius:var(--rounded-box, 1rem);--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));padding:1.5rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1);transition-duration:.2s;box-shadow:#00000040 0 25px 50px -12px;overflow-y:auto;overscroll-behavior:contain}.modal-open,.modal:target,.modal-toggle:checked+.modal,.modal[open]{pointer-events:auto;visibility:visible;opacity:1}:root:has(:is(.modal-open,.modal:target,.modal-toggle:checked+.modal,.modal[open])){overflow:hidden;scrollbar-gutter:stable}.range{height:1.5rem;width:100%;cursor:pointer;-moz-appearance:none;appearance:none;-webkit-appearance:none;--range-shdw: var(--fallback-bc,oklch(var(--bc)/1));overflow:hidden;border-radius:var(--rounded-box, 1rem);background-color:transparent}.range:focus{outline:none}.stats{display:inline-grid;border-radius:var(--rounded-box, 1rem);--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)))}:where(.stats){grid-auto-flow:column;overflow-x:auto}.steps .step{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));grid-template-columns:auto;grid-template-rows:repeat(2,minmax(0,1fr));grid-template-rows:40px 1fr;place-items:center;text-align:center;min-width:4rem}.table{position:relative;width:100%;border-radius:var(--rounded-box, 1rem);text-align:left;font-size:.875rem;line-height:1.25rem}.table :where(.table-pin-rows thead tr){position:sticky;top:0;z-index:1;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)))}.table :where(.table-pin-rows tfoot tr){position:sticky;bottom:0;z-index:1;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)))}.table :where(.table-pin-cols tr th){position:sticky;left:0;right:0;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)))}.btm-nav>*.disabled,.btm-nav>*[disabled]{pointer-events:none;--tw-border-opacity: 0;background-color:var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));--tw-bg-opacity: .1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));--tw-text-opacity: .2}@keyframes button-pop{0%{transform:scale(var(--btn-focus-scale, .98))}40%{transform:scale(1.02)}to{transform:scale(1)}}@keyframes checkmark{0%{background-position-y:5px}50%{background-position-y:-2px}to{background-position-y:0}}.input input{--tw-bg-opacity: 1;background-color:var(--fallback-p,oklch(var(--p)/var(--tw-bg-opacity)));background-color:transparent}.input input:focus{outline:2px solid transparent;outline-offset:2px}.input[list]::-webkit-calendar-picker-indicator{line-height:1em}.input:focus,.input:focus-within{box-shadow:none;border-color:var(--fallback-bc,oklch(var(--bc)/.2));outline-style:solid;outline-width:2px;outline-offset:2px;outline-color:var(--fallback-bc,oklch(var(--bc)/.2))}.input:has(>input[disabled]),.input-disabled,.input:disabled,.input[disabled]{cursor:not-allowed;--tw-border-opacity: 1;border-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)));--tw-bg-opacity: 1;background-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));color:var(--fallback-bc,oklch(var(--bc)/.4))}.input:has(>input[disabled])::-moz-placeholder,.input-disabled::-moz-placeholder,.input:disabled::-moz-placeholder,.input[disabled]::-moz-placeholder{color:var(--fallback-bc,oklch(var(--bc)/var(--tw-placeholder-opacity)));--tw-placeholder-opacity: .2}.input:has(>input[disabled])::placeholder,.input-disabled::placeholder,.input:disabled::placeholder,.input[disabled]::placeholder{color:var(--fallback-bc,oklch(var(--bc)/var(--tw-placeholder-opacity)));--tw-placeholder-opacity: .2}.input:has(>input[disabled])>input[disabled]{cursor:not-allowed}.input::-webkit-date-and-time-value{text-align:inherit}.mockup-browser .mockup-browser-toolbar .input{position:relative;margin-left:auto;margin-right:auto;display:block;height:1.75rem;width:24rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;--tw-bg-opacity: 1;background-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));padding-left:2rem;direction:ltr}.mockup-browser .mockup-browser-toolbar .input:before{content:"";position:absolute;left:.5rem;top:50%;aspect-ratio:1 / 1;height:.75rem;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:9999px;border-width:2px;border-color:currentColor;opacity:.6}.mockup-browser .mockup-browser-toolbar .input:after{content:"";position:absolute;left:1.25rem;top:50%;height:.5rem;--tw-translate-y: 25%;--tw-rotate: -45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:9999px;border-width:1px;border-color:currentColor;opacity:.6}.modal:not(dialog:not(.modal-open)),.modal::backdrop{background-color:#0006;animation:modal-pop .2s ease-out}.modal-backdrop{z-index:-1;grid-column-start:1;grid-row-start:1;display:grid;align-self:stretch;justify-self:stretch;color:transparent}.modal-open .modal-box,.modal-toggle:checked+.modal .modal-box,.modal:target .modal-box,.modal[open] .modal-box{--tw-translate-y: 0px;--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes modal-pop{0%{opacity:0}}@keyframes progress-loading{50%{background-position-x:-115%}}@keyframes radiomark{0%{box-shadow:0 0 0 12px var(--fallback-b1,oklch(var(--b1)/1)) inset,0 0 0 12px var(--fallback-b1,oklch(var(--b1)/1)) inset}50%{box-shadow:0 0 0 3px var(--fallback-b1,oklch(var(--b1)/1)) inset,0 0 0 3px var(--fallback-b1,oklch(var(--b1)/1)) inset}to{box-shadow:0 0 0 4px var(--fallback-b1,oklch(var(--b1)/1)) inset,0 0 0 4px var(--fallback-b1,oklch(var(--b1)/1)) inset}}.range:focus-visible::-webkit-slider-thumb{--focus-shadow: 0 0 0 6px var(--fallback-b1,oklch(var(--b1)/1)) inset, 0 0 0 2rem var(--range-shdw) inset}.range:focus-visible::-moz-range-thumb{--focus-shadow: 0 0 0 6px var(--fallback-b1,oklch(var(--b1)/1)) inset, 0 0 0 2rem var(--range-shdw) inset}.range::-webkit-slider-runnable-track{height:.5rem;width:100%;border-radius:var(--rounded-box, 1rem);background-color:var(--fallback-bc,oklch(var(--bc)/.1))}.range::-moz-range-track{height:.5rem;width:100%;border-radius:var(--rounded-box, 1rem);background-color:var(--fallback-bc,oklch(var(--bc)/.1))}.range::-webkit-slider-thumb{position:relative;height:1.5rem;width:1.5rem;border-radius:var(--rounded-box, 1rem);border-style:none;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));-moz-appearance:none;appearance:none;-webkit-appearance:none;top:50%;color:var(--range-shdw);transform:translateY(-50%);--filler-size: 100rem;--filler-offset: .6rem;box-shadow:0 0 0 3px var(--range-shdw) inset,var(--focus-shadow, 0 0),calc(var(--filler-size) * -1 - var(--filler-offset)) 0 0 var(--filler-size)}.range::-moz-range-thumb{position:relative;height:1.5rem;width:1.5rem;border-radius:var(--rounded-box, 1rem);border-style:none;--tw-bg-opacity: 1;background-color:var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));top:50%;color:var(--range-shdw);--filler-size: 100rem;--filler-offset: .5rem;box-shadow:0 0 0 3px var(--range-shdw) inset,var(--focus-shadow, 0 0),calc(var(--filler-size) * -1 - var(--filler-offset)) 0 0 var(--filler-size)}@keyframes rating-pop{0%{transform:translateY(-.125em)}40%{transform:translateY(-.125em)}to{transform:translateY(0)}}@keyframes skeleton{0%{background-position:150%}to{background-position:-50%}}:where(.stats)>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)));--tw-divide-y-reverse: 0;border-top-width:calc(0px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(0px * var(--tw-divide-y-reverse))}:is([dir=rtl] .stats>:not([hidden])~:not([hidden])){--tw-divide-x-reverse: 1}.steps .step:before{top:0;grid-column-start:1;grid-row-start:1;height:.5rem;width:100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));--tw-bg-opacity: 1;background-color:var(--fallback-b3,oklch(var(--b3)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));content:"";margin-inline-start:-100%}.steps .step:after{content:counter(step);counter-increment:step;z-index:1;position:relative;grid-column-start:1;grid-row-start:1;display:grid;height:2rem;width:2rem;place-items:center;place-self:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:var(--fallback-b3,oklch(var(--b3)/var(--tw-bg-opacity)));--tw-text-opacity: 1;color:var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)))}.steps .step:first-child:before{content:none}.steps .step[data-content]:after{content:attr(data-content)}:is([dir=rtl] .table){text-align:right}.table :where(th,td){padding:.75rem 1rem;vertical-align:middle}.table tr.active,.table tr.active:nth-child(2n),.table-zebra tbody tr:nth-child(2n){--tw-bg-opacity: 1;background-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)))}.table :where(thead tr,tbody tr:not(:last-child),tbody tr:first-child:last-child){border-bottom-width:1px;--tw-border-opacity: 1;border-bottom-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)))}.table :where(thead,tfoot){white-space:nowrap;font-size:.75rem;line-height:1rem;font-weight:700;color:var(--fallback-bc,oklch(var(--bc)/.6))}.table :where(tfoot){border-top-width:1px;--tw-border-opacity: 1;border-top-color:var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)))}@keyframes toast-pop{0%{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}.steps-horizontal .step{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));place-items:center;text-align:center}.steps-vertical .step{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(1,minmax(0,1fr))}.modal-top :where(.modal-box){width:100%;max-width:none;--tw-translate-y: -2.5rem;--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-bottom-right-radius:var(--rounded-box, 1rem);border-bottom-left-radius:var(--rounded-box, 1rem);border-top-left-radius:0;border-top-right-radius:0}.modal-middle :where(.modal-box){width:91.666667%;max-width:32rem;--tw-translate-y: 0px;--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-top-left-radius:var(--rounded-box, 1rem);border-top-right-radius:var(--rounded-box, 1rem);border-bottom-right-radius:var(--rounded-box, 1rem);border-bottom-left-radius:var(--rounded-box, 1rem)}.modal-bottom :where(.modal-box){width:100%;max-width:none;--tw-translate-y: 2.5rem;--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-top-left-radius:var(--rounded-box, 1rem);border-top-right-radius:var(--rounded-box, 1rem);border-bottom-right-radius:0;border-bottom-left-radius:0}.steps-horizontal .step{grid-template-rows:40px 1fr;grid-template-columns:auto;min-width:4rem}.steps-horizontal .step:before{height:.5rem;width:100%;--tw-translate-x: 0px;--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));content:"";margin-inline-start:-100%}:is([dir=rtl] .steps-horizontal .step):before{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.steps-vertical .step{gap:.5rem;grid-template-columns:40px 1fr;grid-template-rows:auto;min-height:4rem;justify-items:start}.steps-vertical .step:before{height:100%;width:.5rem;--tw-translate-x: -50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));margin-inline-start:50%}:is([dir=rtl] .steps-vertical .step):before{--tw-translate-x: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.right-4{right:1rem}.top-0{top:0}.top-4{top:1rem}.m-2{margin:.5rem}.m-auto{margin:auto}.mt-6{margin-top:1.5rem}.block{display:block}.flex{display:flex}.table{display:table}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-4{height:1rem}.h-4\/6{height:66.666667%}.h-5\/6{height:83.333333%}.h-full{height:100%}.h-screen{height:100vh}.max-h-full{max-height:100%}.max-h-screen{max-height:100vh}.w-12{width:3rem}.w-4{width:1rem}.w-60{width:15rem}.w-full{width:100%}.w-screen{width:100vw}.max-w-96{max-width:24rem}.max-w-full{max-width:100%}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-evenly{justify-content:space-evenly}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.self-center{align-self:center}.break-words{overflow-wrap:break-word}.rounded-full{border-radius:9999px}.rounded-none{border-radius:0}.border-2{border-width:2px}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-green-700{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.bg-red-700{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pb-8{padding-bottom:2rem}.pr-2{padding-right:.5rem}.pt-12{padding-top:3rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.font-normal{font-weight:400}.font-thin{font-weight:100}.italic{font-style:italic}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.outline-none{outline:2px solid transparent;outline-offset:2px}.scrollbar::-webkit-scrollbar{width:10px}.scrollbar::-webkit-scrollbar-track{background:transparent}.scrollbar::-webkit-scrollbar-thumb{background:#fff;border:3px solid #f6f7ed}.main-grid{display:grid;grid-template-columns:1fr;grid-template-rows:min-content 1fr 1fr;gap:30px;grid-auto-flow:column;grid-template-areas:"controls" "player" "player-text"}@media screen and (min-width: 768px){.main-grid{grid-template-columns:2fr 2.5fr;grid-template-rows:min-content min-content min-content 1fr;gap:30px 30px;grid-auto-flow:column;align-items:center;justify-items:center;grid-template-areas:"controls controls" "player player-stats" "player player-text" "player player-text"}}.presentation{max-width:450px}.presentation>p{padding-top:10px}.cute-words,.download-links{color:#54e8b3}.explain-links{color:#bcfce5}.controls{grid-area:controls}.player{grid-area:player;grid-template-areas:"server-audio" "user-audio";display:grid;grid-template-columns:1fr;grid-template-rows:1fr 1fr;align-items:center;justify-items:center}.server-audio{grid-area:server-audio}.user-audio{grid-area:user-audio}.player-stats{grid-area:player-stats;width:100%;height:100%}.commands{grid-area:commands;width:100%;height:100%}.player-text{grid-area:player-text;width:100%;height:100%;overflow:scroll}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.focus\:bg-gray-800:focus{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.active\:bg-gray-700:active{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.disabled\:bg-gray-100:disabled{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}@media (min-width: 768px){.md\:block{display:block}.md\:max-w-screen-lg{max-width:1024px}.md\:p-12{padding:3rem}}
assets/index-eKz4obkg.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/logo.svg ADDED
assets/phase-vocoder.min.js ADDED
@@ -0,0 +1,635 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ !(function t(e, s, r) {
2
+ function i(o, f) {
3
+ if (!s[o]) {
4
+ if (!e[o]) {
5
+ var h = "function" == typeof require && require;
6
+ if (!f && h) return h(o, !0);
7
+ if (n) return n(o, !0);
8
+ var u = new Error("Cannot find module '" + o + "'");
9
+ throw ((u.code = "MODULE_NOT_FOUND"), u);
10
+ }
11
+ var a = (s[o] = { exports: {} });
12
+ e[o][0].call(
13
+ a.exports,
14
+ function (t) {
15
+ return i(e[o][1][t] || t);
16
+ },
17
+ a,
18
+ a.exports,
19
+ t,
20
+ e,
21
+ s,
22
+ r,
23
+ );
24
+ }
25
+ return s[o].exports;
26
+ }
27
+ for (
28
+ var n = "function" == typeof require && require, o = 0;
29
+ o < r.length;
30
+ o++
31
+ )
32
+ i(r[o]);
33
+ return i;
34
+ })(
35
+ {
36
+ 1: [
37
+ function (t, e, s) {
38
+ "use strict";
39
+ function r(t) {
40
+ if (
41
+ ((this.size = 0 | t),
42
+ this.size <= 1 || 0 != (this.size & (this.size - 1)))
43
+ )
44
+ throw new Error(
45
+ "FFT size must be a power of two and bigger than 1",
46
+ );
47
+ this._csize = t << 1;
48
+ for (var e = new Array(2 * this.size), s = 0; s < e.length; s += 2) {
49
+ const t = (Math.PI * s) / this.size;
50
+ (e[s] = Math.cos(t)), (e[s + 1] = -Math.sin(t));
51
+ }
52
+ this.table = e;
53
+ for (var r = 0, i = 1; this.size > i; i <<= 1) r++;
54
+ (this._width = r % 2 == 0 ? r - 1 : r),
55
+ (this._bitrev = new Array(1 << this._width));
56
+ for (var n = 0; n < this._bitrev.length; n++) {
57
+ this._bitrev[n] = 0;
58
+ for (var o = 0; o < this._width; o += 2) {
59
+ var f = this._width - o - 2;
60
+ this._bitrev[n] |= ((n >>> o) & 3) << f;
61
+ }
62
+ }
63
+ (this._out = null), (this._data = null), (this._inv = 0);
64
+ }
65
+ (e.exports = r),
66
+ (r.prototype.fromComplexArray = function (t, e) {
67
+ for (
68
+ var s = e || new Array(t.length >>> 1), r = 0;
69
+ r < t.length;
70
+ r += 2
71
+ )
72
+ s[r >>> 1] = t[r];
73
+ return s;
74
+ }),
75
+ (r.prototype.createComplexArray = function () {
76
+ const t = new Array(this._csize);
77
+ for (var e = 0; e < t.length; e++) t[e] = 0;
78
+ return t;
79
+ }),
80
+ (r.prototype.toComplexArray = function (t, e) {
81
+ for (
82
+ var s = e || this.createComplexArray(), r = 0;
83
+ r < s.length;
84
+ r += 2
85
+ )
86
+ (s[r] = t[r >>> 1]), (s[r + 1] = 0);
87
+ return s;
88
+ }),
89
+ (r.prototype.completeSpectrum = function (t) {
90
+ for (var e = this._csize, s = e >>> 1, r = 2; r < s; r += 2)
91
+ (t[e - r] = t[r]), (t[e - r + 1] = -t[r + 1]);
92
+ }),
93
+ (r.prototype.transform = function (t, e) {
94
+ if (t === e)
95
+ throw new Error("Input and output buffers must be different");
96
+ (this._out = t),
97
+ (this._data = e),
98
+ (this._inv = 0),
99
+ this._transform4(),
100
+ (this._out = null),
101
+ (this._data = null);
102
+ }),
103
+ (r.prototype.realTransform = function (t, e) {
104
+ if (t === e)
105
+ throw new Error("Input and output buffers must be different");
106
+ (this._out = t),
107
+ (this._data = e),
108
+ (this._inv = 0),
109
+ this._realTransform4(),
110
+ (this._out = null),
111
+ (this._data = null);
112
+ }),
113
+ (r.prototype.inverseTransform = function (t, e) {
114
+ if (t === e)
115
+ throw new Error("Input and output buffers must be different");
116
+ (this._out = t),
117
+ (this._data = e),
118
+ (this._inv = 1),
119
+ this._transform4();
120
+ for (var s = 0; s < t.length; s++) t[s] /= this.size;
121
+ (this._out = null), (this._data = null);
122
+ }),
123
+ (r.prototype._transform4 = function () {
124
+ var t,
125
+ e,
126
+ s = this._out,
127
+ r = this._csize,
128
+ i = 1 << this._width,
129
+ n = (r / i) << 1,
130
+ o = this._bitrev;
131
+ if (4 === n)
132
+ for (t = 0, e = 0; t < r; t += n, e++) {
133
+ const s = o[e];
134
+ this._singleTransform2(t, s, i);
135
+ }
136
+ else
137
+ for (t = 0, e = 0; t < r; t += n, e++) {
138
+ const s = o[e];
139
+ this._singleTransform4(t, s, i);
140
+ }
141
+ var f = this._inv ? -1 : 1,
142
+ h = this.table;
143
+ for (i >>= 2; i >= 2; i >>= 2) {
144
+ var u = (n = (r / i) << 1) >>> 2;
145
+ for (t = 0; t < r; t += n)
146
+ for (var a = t + u, p = t, l = 0; p < a; p += 2, l += i) {
147
+ const t = p,
148
+ e = t + u,
149
+ r = e + u,
150
+ i = r + u,
151
+ n = s[t],
152
+ o = s[t + 1],
153
+ a = s[e],
154
+ c = s[e + 1],
155
+ d = s[r],
156
+ v = s[r + 1],
157
+ m = s[i],
158
+ b = s[i + 1],
159
+ _ = n,
160
+ B = o,
161
+ g = h[l],
162
+ y = f * h[l + 1],
163
+ w = a * g - c * y,
164
+ S = a * y + c * g,
165
+ z = h[2 * l],
166
+ x = f * h[2 * l + 1],
167
+ C = d * z - v * x,
168
+ I = d * x + v * z,
169
+ k = h[3 * l],
170
+ A = f * h[3 * l + 1],
171
+ T = m * k - b * A,
172
+ O = m * A + b * k,
173
+ q = _ + C,
174
+ P = B + I,
175
+ M = _ - C,
176
+ F = B - I,
177
+ R = w + T,
178
+ W = S + O,
179
+ H = f * (w - T),
180
+ E = f * (S - O),
181
+ N = q + R,
182
+ j = P + W,
183
+ L = q - R,
184
+ D = P - W,
185
+ U = M + E,
186
+ V = F - H,
187
+ G = M - E,
188
+ J = F + H;
189
+ (s[t] = N),
190
+ (s[t + 1] = j),
191
+ (s[e] = U),
192
+ (s[e + 1] = V),
193
+ (s[r] = L),
194
+ (s[r + 1] = D),
195
+ (s[i] = G),
196
+ (s[i + 1] = J);
197
+ }
198
+ }
199
+ }),
200
+ (r.prototype._singleTransform2 = function (t, e, s) {
201
+ const r = this._out,
202
+ i = this._data,
203
+ n = i[e],
204
+ o = i[e + 1],
205
+ f = i[e + s],
206
+ h = i[e + s + 1],
207
+ u = n + f,
208
+ a = o + h,
209
+ p = n - f,
210
+ l = o - h;
211
+ (r[t] = u), (r[t + 1] = a), (r[t + 2] = p), (r[t + 3] = l);
212
+ }),
213
+ (r.prototype._singleTransform4 = function (t, e, s) {
214
+ const r = this._out,
215
+ i = this._data,
216
+ n = this._inv ? -1 : 1,
217
+ o = 2 * s,
218
+ f = 3 * s,
219
+ h = i[e],
220
+ u = i[e + 1],
221
+ a = i[e + s],
222
+ p = i[e + s + 1],
223
+ l = i[e + o],
224
+ c = i[e + o + 1],
225
+ d = i[e + f],
226
+ v = i[e + f + 1],
227
+ m = h + l,
228
+ b = u + c,
229
+ _ = h - l,
230
+ B = u - c,
231
+ g = a + d,
232
+ y = p + v,
233
+ w = n * (a - d),
234
+ S = n * (p - v),
235
+ z = m + g,
236
+ x = b + y,
237
+ C = _ + S,
238
+ I = B - w,
239
+ k = m - g,
240
+ A = b - y,
241
+ T = _ - S,
242
+ O = B + w;
243
+ (r[t] = z),
244
+ (r[t + 1] = x),
245
+ (r[t + 2] = C),
246
+ (r[t + 3] = I),
247
+ (r[t + 4] = k),
248
+ (r[t + 5] = A),
249
+ (r[t + 6] = T),
250
+ (r[t + 7] = O);
251
+ }),
252
+ (r.prototype._realTransform4 = function () {
253
+ var t,
254
+ e,
255
+ s = this._out,
256
+ r = this._csize,
257
+ i = 1 << this._width,
258
+ n = (r / i) << 1,
259
+ o = this._bitrev;
260
+ if (4 === n)
261
+ for (t = 0, e = 0; t < r; t += n, e++) {
262
+ const s = o[e];
263
+ this._singleRealTransform2(t, s >>> 1, i >>> 1);
264
+ }
265
+ else
266
+ for (t = 0, e = 0; t < r; t += n, e++) {
267
+ const s = o[e];
268
+ this._singleRealTransform4(t, s >>> 1, i >>> 1);
269
+ }
270
+ var f = this._inv ? -1 : 1,
271
+ h = this.table;
272
+ for (i >>= 2; i >= 2; i >>= 2) {
273
+ var u = (n = (r / i) << 1) >>> 1,
274
+ a = u >>> 1,
275
+ p = a >>> 1;
276
+ for (t = 0; t < r; t += n)
277
+ for (var l = 0, c = 0; l <= p; l += 2, c += i) {
278
+ var d = t + l,
279
+ v = d + a,
280
+ m = v + a,
281
+ b = m + a,
282
+ _ = s[d],
283
+ B = s[d + 1],
284
+ g = s[v],
285
+ y = s[v + 1],
286
+ w = s[m],
287
+ S = s[m + 1],
288
+ z = s[b],
289
+ x = s[b + 1],
290
+ C = _,
291
+ I = B,
292
+ k = h[c],
293
+ A = f * h[c + 1],
294
+ T = g * k - y * A,
295
+ O = g * A + y * k,
296
+ q = h[2 * c],
297
+ P = f * h[2 * c + 1],
298
+ M = w * q - S * P,
299
+ F = w * P + S * q,
300
+ R = h[3 * c],
301
+ W = f * h[3 * c + 1],
302
+ H = z * R - x * W,
303
+ E = z * W + x * R,
304
+ N = C + M,
305
+ j = I + F,
306
+ L = C - M,
307
+ D = I - F,
308
+ U = T + H,
309
+ V = O + E,
310
+ G = f * (T - H),
311
+ J = f * (O - E),
312
+ K = N + U,
313
+ Q = j + V,
314
+ X = L + J,
315
+ Y = D - G;
316
+ if (
317
+ ((s[d] = K),
318
+ (s[d + 1] = Q),
319
+ (s[v] = X),
320
+ (s[v + 1] = Y),
321
+ 0 !== l)
322
+ ) {
323
+ if (l !== p) {
324
+ var Z = L + -f * J,
325
+ $ = -D + -f * G,
326
+ tt = N + -f * U,
327
+ et = -j - -f * V,
328
+ st = t + a - l,
329
+ rt = t + u - l;
330
+ (s[st] = Z),
331
+ (s[st + 1] = $),
332
+ (s[rt] = tt),
333
+ (s[rt + 1] = et);
334
+ }
335
+ } else {
336
+ var it = N - U,
337
+ nt = j - V;
338
+ (s[m] = it), (s[m + 1] = nt);
339
+ }
340
+ }
341
+ }
342
+ }),
343
+ (r.prototype._singleRealTransform2 = function (t, e, s) {
344
+ const r = this._out,
345
+ i = this._data,
346
+ n = i[e],
347
+ o = i[e + s],
348
+ f = n + o,
349
+ h = n - o;
350
+ (r[t] = f), (r[t + 1] = 0), (r[t + 2] = h), (r[t + 3] = 0);
351
+ }),
352
+ (r.prototype._singleRealTransform4 = function (t, e, s) {
353
+ const r = this._out,
354
+ i = this._data,
355
+ n = this._inv ? -1 : 1,
356
+ o = 2 * s,
357
+ f = 3 * s,
358
+ h = i[e],
359
+ u = i[e + s],
360
+ a = i[e + o],
361
+ p = i[e + f],
362
+ l = h + a,
363
+ c = h - a,
364
+ d = u + p,
365
+ v = n * (u - p),
366
+ m = l + d,
367
+ b = c,
368
+ _ = -v,
369
+ B = l - d,
370
+ g = c,
371
+ y = v;
372
+ (r[t] = m),
373
+ (r[t + 1] = 0),
374
+ (r[t + 2] = b),
375
+ (r[t + 3] = _),
376
+ (r[t + 4] = B),
377
+ (r[t + 5] = 0),
378
+ (r[t + 6] = g),
379
+ (r[t + 7] = y);
380
+ });
381
+ },
382
+ {},
383
+ ],
384
+ 2: [
385
+ function (t, e, s) {
386
+ "use strict";
387
+ const r = 128;
388
+ class i extends AudioWorkletProcessor {
389
+ constructor(t) {
390
+ super(t),
391
+ (this.nbInputs = t.numberOfInputs),
392
+ (this.nbOutputs = t.numberOfOutputs),
393
+ (this.blockSize = t.processorOptions.blockSize),
394
+ (this.hopSize = r),
395
+ (this.nbOverlaps = this.blockSize / this.hopSize),
396
+ (this.inputBuffers = new Array(this.nbInputs)),
397
+ (this.inputBuffersHead = new Array(this.nbInputs)),
398
+ (this.inputBuffersToSend = new Array(this.nbInputs));
399
+ for (var e = 0; e < this.nbInputs; e++)
400
+ this.allocateInputChannels(e, 1);
401
+ (this.outputBuffers = new Array(this.nbOutputs)),
402
+ (this.outputBuffersToRetrieve = new Array(this.nbOutputs));
403
+ for (e = 0; e < this.nbOutputs; e++)
404
+ this.allocateOutputChannels(e, 1);
405
+ }
406
+ reallocateChannelsIfNeeded(t, e) {
407
+ for (var s = 0; s < this.nbInputs; s++) {
408
+ let e = t[s].length;
409
+ e != this.inputBuffers[s].length &&
410
+ this.allocateInputChannels(s, e);
411
+ }
412
+ for (s = 0; s < this.nbOutputs; s++) {
413
+ let t = e[s].length;
414
+ t != this.outputBuffers[s].length &&
415
+ this.allocateOutputChannels(s, t);
416
+ }
417
+ }
418
+ allocateInputChannels(t, e) {
419
+ this.inputBuffers[t] = new Array(e);
420
+ for (var s = 0; s < e; s++)
421
+ (this.inputBuffers[t][s] = new Float32Array(this.blockSize + r)),
422
+ this.inputBuffers[t][s].fill(0);
423
+ (this.inputBuffersHead[t] = new Array(e)),
424
+ (this.inputBuffersToSend[t] = new Array(e));
425
+ for (s = 0; s < e; s++)
426
+ (this.inputBuffersHead[t][s] = this.inputBuffers[t][s].subarray(
427
+ 0,
428
+ this.blockSize,
429
+ )),
430
+ (this.inputBuffersToSend[t][s] = new Float32Array(
431
+ this.blockSize,
432
+ ));
433
+ }
434
+ allocateOutputChannels(t, e) {
435
+ this.outputBuffers[t] = new Array(e);
436
+ for (var s = 0; s < e; s++)
437
+ (this.outputBuffers[t][s] = new Float32Array(this.blockSize)),
438
+ this.outputBuffers[t][s].fill(0);
439
+ this.outputBuffersToRetrieve[t] = new Array(e);
440
+ for (s = 0; s < e; s++)
441
+ (this.outputBuffersToRetrieve[t][s] = new Float32Array(
442
+ this.blockSize,
443
+ )),
444
+ this.outputBuffersToRetrieve[t][s].fill(0);
445
+ }
446
+ readInputs(t) {
447
+ if (t[0].length && 0 == t[0][0].length)
448
+ for (var e = 0; e < this.nbInputs; e++)
449
+ for (var s = 0; s < this.inputBuffers[e].length; s++)
450
+ this.inputBuffers[e][s].fill(0, this.blockSize);
451
+ else
452
+ for (e = 0; e < this.nbInputs; e++)
453
+ for (s = 0; s < this.inputBuffers[e].length; s++) {
454
+ let r = t[e][s];
455
+ this.inputBuffers[e][s].set(r, this.blockSize);
456
+ }
457
+ }
458
+ writeOutputs(t) {
459
+ for (var e = 0; e < this.nbInputs; e++)
460
+ for (var s = 0; s < this.inputBuffers[e].length; s++) {
461
+ let i = this.outputBuffers[e][s].subarray(0, r);
462
+ t[e][s].set(i);
463
+ }
464
+ }
465
+ shiftInputBuffers() {
466
+ for (var t = 0; t < this.nbInputs; t++)
467
+ for (var e = 0; e < this.inputBuffers[t].length; e++)
468
+ this.inputBuffers[t][e].copyWithin(0, r);
469
+ }
470
+ shiftOutputBuffers() {
471
+ for (var t = 0; t < this.nbOutputs; t++)
472
+ for (var e = 0; e < this.outputBuffers[t].length; e++)
473
+ this.outputBuffers[t][e].copyWithin(0, r),
474
+ this.outputBuffers[t][e].subarray(this.blockSize - r).fill(0);
475
+ }
476
+ prepareInputBuffersToSend() {
477
+ for (var t = 0; t < this.nbInputs; t++)
478
+ for (var e = 0; e < this.inputBuffers[t].length; e++)
479
+ this.inputBuffersToSend[t][e].set(this.inputBuffersHead[t][e]);
480
+ }
481
+ handleOutputBuffersToRetrieve() {
482
+ for (var t = 0; t < this.nbOutputs; t++)
483
+ for (var e = 0; e < this.outputBuffers[t].length; e++)
484
+ for (var s = 0; s < this.blockSize; s++)
485
+ this.outputBuffers[t][e][s] +=
486
+ this.outputBuffersToRetrieve[t][e][s] / this.nbOverlaps;
487
+ }
488
+ process(t, e, s) {
489
+ return (
490
+ this.reallocateChannelsIfNeeded(t, e),
491
+ this.readInputs(t),
492
+ this.shiftInputBuffers(),
493
+ this.prepareInputBuffersToSend(),
494
+ this.processOLA(
495
+ this.inputBuffersToSend,
496
+ this.outputBuffersToRetrieve,
497
+ s,
498
+ ),
499
+ this.handleOutputBuffersToRetrieve(),
500
+ this.writeOutputs(e),
501
+ this.shiftOutputBuffers(),
502
+ !0
503
+ );
504
+ }
505
+ processOLA(t, e, s) {
506
+ console.assert(!1, "Not overriden");
507
+ }
508
+ }
509
+ e.exports = i;
510
+ },
511
+ {},
512
+ ],
513
+ 3: [
514
+ function (t, e, s) {
515
+ "use strict";
516
+ const r = t("./ola-processor.js"),
517
+ i = t("fft.js");
518
+ registerProcessor(
519
+ "phase-vocoder-processor",
520
+ class extends r {
521
+ static get parameterDescriptors() {
522
+ return [{ name: "pitchFactor", defaultValue: 1 }];
523
+ }
524
+ constructor(t) {
525
+ (t.processorOptions = { blockSize: 2048 }),
526
+ super(t),
527
+ (this.fftSize = this.blockSize),
528
+ (this.timeCursor = 0),
529
+ (this.hannWindow = (function (t) {
530
+ let e = new Float32Array(t);
531
+ for (var s = 0; s < t; s++)
532
+ e[s] = 0.5 * (1 - Math.cos((2 * Math.PI * s) / t));
533
+ return e;
534
+ })(this.blockSize)),
535
+ (this.fft = new i(this.fftSize)),
536
+ (this.freqComplexBuffer = this.fft.createComplexArray()),
537
+ (this.freqComplexBufferShifted = this.fft.createComplexArray()),
538
+ (this.timeComplexBuffer = this.fft.createComplexArray()),
539
+ (this.magnitudes = new Float32Array(this.fftSize / 2 + 1)),
540
+ (this.peakIndexes = new Int32Array(this.magnitudes.length)),
541
+ (this.nbPeaks = 0);
542
+ }
543
+ processOLA(t, e, s) {
544
+ const r = s.pitchFactor[s.pitchFactor.length - 1];
545
+ for (var i = 0; i < this.nbInputs; i++)
546
+ for (var n = 0; n < t[i].length; n++) {
547
+ var o = t[i][n],
548
+ f = e[i][n];
549
+ this.applyHannWindow(o),
550
+ this.fft.realTransform(this.freqComplexBuffer, o),
551
+ this.computeMagnitudes(),
552
+ this.findPeaks(),
553
+ this.shiftPeaks(r),
554
+ this.fft.completeSpectrum(this.freqComplexBufferShifted),
555
+ this.fft.inverseTransform(
556
+ this.timeComplexBuffer,
557
+ this.freqComplexBufferShifted,
558
+ ),
559
+ this.fft.fromComplexArray(this.timeComplexBuffer, f),
560
+ this.applyHannWindow(f);
561
+ }
562
+ this.timeCursor += this.hopSize;
563
+ }
564
+ applyHannWindow(t) {
565
+ for (var e = 0; e < this.blockSize; e++)
566
+ t[e] = t[e] * this.hannWindow[e];
567
+ }
568
+ computeMagnitudes() {
569
+ for (var t = 0, e = 0; t < this.magnitudes.length; ) {
570
+ let s = this.freqComplexBuffer[e],
571
+ r = this.freqComplexBuffer[e + 1];
572
+ (this.magnitudes[t] = s ** 2 + r ** 2), (t += 1), (e += 2);
573
+ }
574
+ }
575
+ findPeaks() {
576
+ this.nbPeaks = 0;
577
+ var t = 2;
578
+ let e = this.magnitudes.length - 2;
579
+ for (; t < e; ) {
580
+ let e = this.magnitudes[t];
581
+ this.magnitudes[t - 1] >= e || this.magnitudes[t - 2] >= e
582
+ ? t++
583
+ : this.magnitudes[t + 1] >= e || this.magnitudes[t + 2] >= e
584
+ ? t++
585
+ : ((this.peakIndexes[this.nbPeaks] = t),
586
+ this.nbPeaks++,
587
+ (t += 2));
588
+ }
589
+ }
590
+ shiftPeaks(t) {
591
+ this.freqComplexBufferShifted.fill(0);
592
+ for (var e = 0; e < this.nbPeaks; e++) {
593
+ let n = this.peakIndexes[e],
594
+ o = Math.round(n * t);
595
+ if (o > this.magnitudes.length) break;
596
+ var s = 0,
597
+ r = this.fftSize;
598
+ if (e > 0) {
599
+ let t = this.peakIndexes[e - 1];
600
+ s = n - Math.floor((n - t) / 2);
601
+ }
602
+ if (e < this.nbPeaks - 1) {
603
+ let t = this.peakIndexes[e + 1];
604
+ r = n + Math.ceil((t - n) / 2);
605
+ }
606
+ let f = r - n;
607
+ for (var i = s - n; i < f; i++) {
608
+ let t = n + i,
609
+ e = o + i;
610
+ if (e >= this.magnitudes.length) break;
611
+ let s = (2 * Math.PI * (e - t)) / this.fftSize,
612
+ r = Math.cos(s * this.timeCursor),
613
+ f = Math.sin(s * this.timeCursor),
614
+ h = 2 * t,
615
+ u = h + 1,
616
+ a = this.freqComplexBuffer[h],
617
+ p = this.freqComplexBuffer[u],
618
+ l = a * r - p * f,
619
+ c = a * f + p * r,
620
+ d = 2 * e,
621
+ v = d + 1;
622
+ (this.freqComplexBufferShifted[d] += l),
623
+ (this.freqComplexBufferShifted[v] += c);
624
+ }
625
+ }
626
+ }
627
+ },
628
+ );
629
+ },
630
+ { "./ola-processor.js": 2, "fft.js": 1 },
631
+ ],
632
+ },
633
+ {},
634
+ [3],
635
+ );