Línea 1... |
Línea 1... |
1 |
|
1 |
|
2 |
var OGVDecoderAudioVorbisW = (() => {
|
2 |
var OGVDecoderAudioVorbisW = (() => {
|
3 |
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
3 |
var _scriptDir = typeof document != 'undefined' ? document.currentScript?.src : undefined;
|
4 |
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
4 |
if (typeof __filename != 'undefined') _scriptDir ||= __filename;
|
5 |
return (
|
5 |
return (
|
6 |
function(OGVDecoderAudioVorbisW) {
|
- |
|
Línea 7... |
Línea -... |
7 |
OGVDecoderAudioVorbisW = OGVDecoderAudioVorbisW || {};
|
- |
|
8 |
|
- |
|
9 |
|
6 |
function(moduleArg = {}) {
|
10 |
var b;b||(b=typeof OGVDecoderAudioVorbisW !== 'undefined' ? OGVDecoderAudioVorbisW : {});var h,k;b.ready=new Promise(function(a,c){h=a;k=c});var m=b,n=Object.assign({},b),p=(a,c)=>{throw c;},q="object"==typeof window,r="function"==typeof importScripts,t="",u,v,w,fs,x,y;
|
7 |
|
11 |
if("object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node)t=r?require("path").dirname(t)+"/":__dirname+"/",y=()=>{x||(fs=require("fs"),x=require("path"))},u=function(a,c){y();a=x.normalize(a);return fs.readFileSync(a,c?void 0:"utf8")},w=a=>{a=u(a,!0);a.buffer||(a=new Uint8Array(a));return a},v=(a,c,e)=>{y();a=x.normalize(a);fs.readFile(a,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
|
8 |
var b=moduleArg,g,k,readyPromise=new Promise((a,c)=>{g=a;k=c}),m=Object.assign({},b),n=(a,c)=>{throw c;},p="object"==typeof window,q="function"==typeof importScripts,r="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,t="",u,v,w;
|
12 |
process.on("unhandledRejection",function(a){throw a;}),p=(a,c)=>{if(noExitRuntime)throw process.exitCode=a,c;c instanceof z||A("exiting due to exception: "+c);process.exit(a)},b.inspect=function(){return"[Emscripten Module object]"};else if(q||r)r?t=self.location.href:"undefined"!=typeof document&&document.currentScript&&(t=document.currentScript.src),_scriptDir&&(t=_scriptDir),0!==t.indexOf("blob:")?t=t.substr(0,t.replace(/[?#].*/,"").lastIndexOf("/")+1):t="",u=a=>{var c=new XMLHttpRequest;c.open("GET",
|
9 |
if(r){var fs=require("fs"),x=require("path");t=q?x.dirname(t)+"/":__dirname+"/";u=(a,c)=>{a=y(a)?new URL(a):x.normalize(a);return fs.readFileSync(a,c?void 0:"utf8")};w=a=>{a=u(a,!0);a.buffer||(a=new Uint8Array(a));return a};v=(a,c,e,d=!0)=>{a=y(a)?new URL(a):x.normalize(a);fs.readFile(a,d?void 0:"utf8",(f,l)=>{f?e(f):c(d?l.buffer:l)})};process.argv.slice(2);n=(a,c)=>{process.exitCode=a;throw c;}}else if(p||q)q?t=self.location.href:"undefined"!=typeof document&&document.currentScript&&(t=document.currentScript.src),
|
13 |
a,!1);c.send(null);return c.responseText},r&&(w=a=>{var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),v=(a,c,e)=>{var d=new XMLHttpRequest;d.open("GET",a,!0);d.responseType="arraybuffer";d.onload=()=>{200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};b.print||console.log.bind(console);var A=b.printErr||console.warn.bind(console);Object.assign(b,n);n=null;b.quit&&(p=b.quit);var B;
|
- |
|
14 |
b.wasmBinary&&(B=b.wasmBinary);var noExitRuntime=b.noExitRuntime||!0;"object"!=typeof WebAssembly&&C("no native wasm support detected");var D,E=!1,F,G;function H(){var a=D.buffer;F=a;b.HEAP8=new Int8Array(a);b.HEAP16=new Int16Array(a);b.HEAP32=new Int32Array(a);b.HEAPU8=G=new Uint8Array(a);b.HEAPU16=new Uint16Array(a);b.HEAPU32=new Uint32Array(a);b.HEAPF32=new Float32Array(a);b.HEAPF64=new Float64Array(a)}var I,J=[],K=[],L=[];function aa(){var a=b.preRun.shift();J.unshift(a)}var M=0,N=null,O=null;
|
10 |
_scriptDir&&(t=_scriptDir),t.startsWith("blob:")?t="":t=t.substr(0,t.replace(/[?#].*/,"").lastIndexOf("/")+1),u=a=>{var c=new XMLHttpRequest;c.open("GET",a,!1);c.send(null);return c.responseText},q&&(w=a=>{var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),v=(a,c,e)=>{var d=new XMLHttpRequest;d.open("GET",a,!0);d.responseType="arraybuffer";d.onload=()=>{200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};
|
15 |
b.preloadedImages={};b.preloadedAudios={};function C(a){if(b.onAbort)b.onAbort(a);a="Aborted("+a+")";A(a);E=!0;a=new WebAssembly.RuntimeError(a+". Build with -s ASSERTIONS=1 for more info.");k(a);throw a;}function P(){return Q.startsWith("data:application/octet-stream;base64,")}var Q;Q="ogv-decoder-audio-vorbis-wasm.wasm";if(!P()){var R=Q;Q=b.locateFile?b.locateFile(R,t):t+R}
|
11 |
b.print||console.log.bind(console);var z=b.printErr||console.error.bind(console);Object.assign(b,m);m=null;b.quit&&(n=b.quit);var A;b.wasmBinary&&(A=b.wasmBinary);var B,C=!1,D;function E(){var a=B.buffer;b.HEAP8=new Int8Array(a);b.HEAP16=new Int16Array(a);b.HEAPU8=D=new Uint8Array(a);b.HEAPU16=new Uint16Array(a);b.HEAP32=new Int32Array(a);b.HEAPU32=new Uint32Array(a);b.HEAPF32=new Float32Array(a);b.HEAPF64=new Float64Array(a)}var F=[],G=[],H=[];function I(){var a=b.preRun.shift();F.unshift(a)}
|
16 |
function ba(){var a=Q;try{if(a==Q&&B)return new Uint8Array(B);if(w)return w(a);throw"both async and sync fetching of the wasm failed";}catch(c){C(c)}}
|
12 |
var J=0,K=null,L=null,M=a=>a.startsWith("data:application/octet-stream;base64,"),y=a=>a.startsWith("file://"),N;N="ogv-decoder-audio-vorbis-wasm.wasm";if(!M(N)){var O=N;N=b.locateFile?b.locateFile(O,t):t+O}function P(a){if(a==N&&A)return new Uint8Array(A);if(w)return w(a);throw"both async and sync fetching of the wasm failed";}
|
17 |
function ca(){if(!B&&(q||r)){if("function"==typeof fetch&&!Q.startsWith("file://"))return fetch(Q,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+Q+"'";return a.arrayBuffer()}).catch(function(){return ba()});if(v)return new Promise(function(a,c){v(Q,function(e){a(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return ba()})}
|
13 |
function aa(a){if(!A&&(p||q)){if("function"==typeof fetch&&!y(a))return fetch(a,{credentials:"same-origin"}).then(c=>{if(!c.ok)throw`failed to load wasm binary file at '${a}'`;return c.arrayBuffer()}).catch(()=>P(a));if(v)return new Promise((c,e)=>{v(a,d=>c(new Uint8Array(d)),e)})}return Promise.resolve().then(()=>P(a))}
|
18 |
function S(a){for(;0<a.length;){var c=a.shift();if("function"==typeof c)c(b);else{var e=c.s;"number"==typeof e?void 0===c.o?da(e)():da(e)(c.o):e(void 0===c.o?null:c.o)}}}var T=[];function da(a){var c=T[a];c||(a>=T.length&&(T.length=a+1),T[a]=c=I.get(a));return c}
|
14 |
function Q(a,c,e){return aa(a).then(d=>WebAssembly.instantiate(d,c)).then(e,d=>{z(`failed to asynchronously prepare wasm: ${d}`);b.onAbort?.(d);d="Aborted("+d+")";z(d);C=!0;d=new WebAssembly.RuntimeError(d+". Build with -sASSERTIONS for more info.");k(d);throw d;})}
|
19 |
var ea={b:function(a,c,e){G.copyWithin(a,c,c+e)},a:function(a){var c=G.length;a>>>=0;if(2147483648<a)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,a+100663296);var f=Math;d=Math.max(a,d);f=f.min.call(f,2147483648,d+(65536-d%65536)%65536);a:{try{D.grow(f-F.byteLength+65535>>>16);H();var g=1;break a}catch(l){}g=void 0}if(g)return!0}return!1},c:function(a){if(!noExitRuntime){if(b.onExit)b.onExit(a);E=!0}p(a,new z(a))},d:function(a,c,e){var d=D.buffer,f=new Uint32Array(d,a,c),g=[];if(0!==
|
15 |
function ba(a,c){var e=N;return A||"function"!=typeof WebAssembly.instantiateStreaming||M(e)||y(e)||r||"function"!=typeof fetch?Q(e,a,c):fetch(e,{credentials:"same-origin"}).then(d=>WebAssembly.instantiateStreaming(d,a).then(c,function(f){z(`wasm streaming compile failed: ${f}`);z("falling back to ArrayBuffer instantiation");return Q(e,a,c)}))}function ca(a){this.name="ExitStatus";this.message=`Program terminated with exit(${a})`;this.status=a}
|
20 |
a)for(a=0;a<c;a++){var l=f[a];d.slice?(l=d.slice(l,l+4*e),l=new Float32Array(l)):(l=new Float32Array(d,l,e),l=new Float32Array(l));g.push(l)}b.audioBuffer=g},e:function(a,c){b.audioFormat={channels:a,rate:c};b.loadedMetadata=!0}};
|
16 |
var R=a=>{for(;0<a.length;)a.shift()(b)},da=b.noExitRuntime||!0,ea={b:(a,c,e)=>D.copyWithin(a,c,c+e),a:a=>{var c=D.length;a>>>=0;if(2147483648<a)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,a+100663296);var f=Math;d=Math.max(a,d);a:{f=(f.min.call(f,2147483648,d+(65536-d%65536)%65536)-B.buffer.byteLength+65535)/65536;try{B.grow(f);E();var l=1;break a}catch(h){}l=void 0}if(l)return!0}return!1},c:a=>{da||(b.onExit?.(a),C=!0);n(a,new ca(a))},d:function(a,c,e){var d=B.buffer,f=new Uint32Array(d,
|
21 |
(function(){function a(f){b.asm=f.exports;D=b.asm.f;H();I=b.asm.n;K.unshift(b.asm.g);M--;b.monitorRunDependencies&&b.monitorRunDependencies(M);0==M&&(null!==N&&(clearInterval(N),N=null),O&&(f=O,O=null,f()))}function c(f){a(f.instance)}function e(f){return ca().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){A("failed to asynchronously prepare wasm: "+g);C(g)})}var d={a:ea};M++;b.monitorRunDependencies&&b.monitorRunDependencies(M);if(b.instantiateWasm)try{return b.instantiateWasm(d,
|
17 |
a,c),l=[];if(0!==a)for(a=0;a<c;a++){var h=f[a];d.slice?(h=d.slice(h,h+4*e),h=new Float32Array(h)):(h=new Float32Array(d,h,e),h=new Float32Array(h));l.push(h)}b.audioBuffer=l},e:function(a,c){b.audioFormat={channels:a,rate:c};b.loadedMetadata=!0}},S=function(){function a(e){S=e.exports;B=S.f;E();G.unshift(S.g);J--;b.monitorRunDependencies?.(J);0==J&&(null!==K&&(clearInterval(K),K=null),L&&(e=L,L=null,e()));return S}var c={a:ea};J++;b.monitorRunDependencies?.(J);if(b.instantiateWasm)try{return b.instantiateWasm(c,
|
22 |
a)}catch(f){return A("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return B||"function"!=typeof WebAssembly.instantiateStreaming||P()||Q.startsWith("file://")||"function"!=typeof fetch?e(c):fetch(Q,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){A("wasm streaming compile failed: "+g);A("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(k);return{}})();
|
- |
|
23 |
b.___wasm_call_ctors=function(){return(b.___wasm_call_ctors=b.asm.g).apply(null,arguments)};b._ogv_audio_decoder_init=function(){return(b._ogv_audio_decoder_init=b.asm.h).apply(null,arguments)};b._ogv_audio_decoder_process_header=function(){return(b._ogv_audio_decoder_process_header=b.asm.i).apply(null,arguments)};b._ogv_audio_decoder_process_audio=function(){return(b._ogv_audio_decoder_process_audio=b.asm.j).apply(null,arguments)};
|
18 |
a)}catch(e){z(`Module.instantiateWasm callback failed with error: ${e}`),k(e)}ba(c,function(e){a(e.instance)}).catch(k);return{}}();b._ogv_audio_decoder_init=()=>(b._ogv_audio_decoder_init=S.h)();b._ogv_audio_decoder_process_header=(a,c)=>(b._ogv_audio_decoder_process_header=S.i)(a,c);b._ogv_audio_decoder_process_audio=(a,c)=>(b._ogv_audio_decoder_process_audio=S.j)(a,c);b._ogv_audio_decoder_destroy=()=>(b._ogv_audio_decoder_destroy=S.k)();b._malloc=a=>(b._malloc=S.l)(a);b._free=a=>(b._free=S.m)(a);
|
24 |
b._ogv_audio_decoder_destroy=function(){return(b._ogv_audio_decoder_destroy=b.asm.k).apply(null,arguments)};b._malloc=function(){return(b._malloc=b.asm.l).apply(null,arguments)};b._free=function(){return(b._free=b.asm.m).apply(null,arguments)};var U;function z(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}O=function fa(){U||V();U||(O=fa)};
|
19 |
var T;L=function fa(){T||U();T||(L=fa)};
|
25 |
function V(){function a(){if(!U&&(U=!0,b.calledRun=!0,!E)){S(K);h(b);if(b.onRuntimeInitialized)b.onRuntimeInitialized();if(b.postRun)for("function"==typeof b.postRun&&(b.postRun=[b.postRun]);b.postRun.length;){var c=b.postRun.shift();L.unshift(c)}S(L)}}if(!(0<M)){if(b.preRun)for("function"==typeof b.preRun&&(b.preRun=[b.preRun]);b.preRun.length;)aa();S(J);0<M||(b.setStatus?(b.setStatus("Running..."),setTimeout(function(){setTimeout(function(){b.setStatus("")},1);a()},1)):a())}}b.run=V;
|
20 |
function U(){function a(){if(!T&&(T=!0,b.calledRun=!0,!C)){R(G);g(b);if(b.onRuntimeInitialized)b.onRuntimeInitialized();if(b.postRun)for("function"==typeof b.postRun&&(b.postRun=[b.postRun]);b.postRun.length;){var c=b.postRun.shift();H.unshift(c)}R(H)}}if(!(0<J)){if(b.preRun)for("function"==typeof b.preRun&&(b.preRun=[b.preRun]);b.preRun.length;)I();R(F);0<J||(b.setStatus?(b.setStatus("Running..."),setTimeout(function(){setTimeout(function(){b.setStatus("")},1);a()},1)):a())}}
|
26 |
if(b.preInit)for("function"==typeof b.preInit&&(b.preInit=[b.preInit]);0<b.preInit.length;)b.preInit.pop()();V();var W,X;function ha(a){if(W&&X>=a)return W;W&&b._free(W);X=a;return W=b._malloc(X)}var Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(a){var c=Y();a=a();b.cpuTime+=Y()-c;return a}b.loadedMetadata=!!m.audioFormat;b.audioFormat=m.audioFormat||null;b.audioBuffer=null;b.cpuTime=0;
|
21 |
if(b.preInit)for("function"==typeof b.preInit&&(b.preInit=[b.preInit]);0<b.preInit.length;)b.preInit.pop()();U();var V,W;function X(a){if(V&&W>=a)return V;V&&b._free(V);W=a;return V=b._malloc(W)}var Y;Y="undefined"===typeof performance||"undefined"===typeof performance.now?Date.now:performance.now.bind(performance);function Z(a){var c=Y();a=a();b.cpuTime+=Y()-c;return a}b.loadedMetadata=!!b.audioFormat;b.audioFormat=b.audioFormat||null;b.audioBuffer=null;b.cpuTime=0;
|
Línea 27... |
Línea 22... |
27 |
Object.defineProperty(b,"processing",{get:function(){return!1}});b.init=function(a){Z(function(){b._ogv_audio_decoder_init()});a()};b.processHeader=function(a,c){var e=Z(function(){var d=a.byteLength,f=ha(d);(new Uint8Array(D.buffer,f,d)).set(new Uint8Array(a));return b._ogv_audio_decoder_process_header(f,d)});c(e)};b.processAudio=function(a,c){var e=Z(function(){var d=a.byteLength,f=ha(d);(new Uint8Array(D.buffer,f,d)).set(new Uint8Array(a));return b._ogv_audio_decoder_process_audio(f,d)});c(e)};
|
22 |
Object.defineProperty(b,"processing",{get:function(){return!1}});b.init=function(a){Z(function(){b._ogv_audio_decoder_init()});a()};b.processHeader=function(a,c){var e=Z(function(){var d=a.byteLength,f=X(d);(new Uint8Array(B.buffer,f,d)).set(new Uint8Array(a));return b._ogv_audio_decoder_process_header(f,d)});c(e)};b.processAudio=function(a,c){var e=Z(function(){var d=a.byteLength,f=X(d);(new Uint8Array(B.buffer,f,d)).set(new Uint8Array(a));return b._ogv_audio_decoder_process_audio(f,d)});c(e)};
|
28 |
b.close=function(){};
|
23 |
b.close=function(){};
|
29 |
|
24 |
|
30 |
|
25 |
|
31 |
return OGVDecoderAudioVorbisW.ready
|
26 |
return readyPromise
|
32 |
}
|
27 |
}
|
33 |
);
|
28 |
);
|
34 |
})();
|
29 |
})();
|
35 |
if (typeof exports === 'object' && typeof module === 'object')
|
- |
|
36 |
module.exports = OGVDecoderAudioVorbisW;
|
- |
|