12 |
- !function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s="ePNF")}({ePNF:function(t,e){self.onmessage=function(t){r.transcode(t.data)};let r={transcode(t){let e=r.to16kHz(t);e=r.to16BitPCM(e),e=Array.from(new Uint8Array(e.buffer)),self.postMessage(e)},to16kHz(t){var e=new Float32Array(t),r=Math.round(e.length*(16e3/44100)),n=new Float32Array(r),o=(e.length-1)/(r-1);n[0]=e[0];for(let t=1;t<r-1;t++){var a=t*o,l=Math.floor(a).toFixed(),u=Math.ceil(a).toFixed(),f=a-l;n[t]=e[l]+(e[u]-e[l])*f}return n[r-1]=e[e.length-1],n},to16BitPCM(t){for(var e=2*t.length,r=new ArrayBuffer(e),n=new DataView(r),o=0,a=0;a<t.length;a++,o+=2){var l=Math.max(-1,Math.min(1,t[a]));n.setInt16(o,l<0?32768*l:32767*l,!0)}return n}}}});
- //# sourceMappingURL=workerName.c61dad805b4c34495429.js.map
|