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AAO5B,EAAG,EAGrC,IAAIX,EAAe,KAAwB/F,YAAYO,MAAMX,IAC3DuD,KAAKoF,cAAc,OAAQ,CAAE3I,SAAQgG,WAAU,GAEnD,CAEA,mBAAM2C,CAAc5B,EAASnG,GAC3B,OAAO,IAAIV,SAASC,IAClBoD,KAAKmE,YAAY,CACfX,UACAD,GAAIvD,KAAK8E,EACTzH,SAGF2C,KAAKiF,EAAoBvI,IAAIsD,KAAK8E,IAAOlI,EAAQ,GAErD,CAEA,SAAIuF,GACF,OAAOnC,KAAKoF,cAAc,QAC5B,CAEA,UAAMnE,SACEjB,KAAKoF,cAAc,QAAQC,SAAQ,KACvCrF,KAAKsF,WAAW,GAEpB,CAEA,WAAMzB,SACE7D,KAAKoF,cAAc,QAC3B,E,+BC/HK,MAAMG,EAAc,CAACC,EAAO9C,KACjCvG,OAAO4D,eAAeyF,EAAO,OAAQ,CAAEnJ,MAAOqG,GAAO,C","sources":["webpack://IcecastMetadataPlayer/./node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderCommon.js","webpack://IcecastMetadataPlayer/./node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderWorker.js","webpack://IcecastMetadataPlayer/./node_modules/@wasm-audio-decoders/common/src/utilities.js"],"sourcesContent":["import { decode } from \"simple-yenc\";\n\nexport default function WASMAudioDecoderCommon() {\n // setup static methods\n const uint8Array = Uint8Array;\n const float32Array = Float32Array;\n\n if (!WASMAudioDecoderCommon.modules) {\n Object.defineProperties(WASMAudioDecoderCommon, {\n modules: {\n value: new WeakMap(),\n },\n\n setModule: {\n value(Ref, module) {\n WASMAudioDecoderCommon.modules.set(Ref, Promise.resolve(module));\n },\n },\n\n getModule: {\n value(Ref, wasmString) {\n let module = WASMAudioDecoderCommon.modules.get(Ref);\n\n if (!module) {\n if (!wasmString) {\n wasmString = Ref.wasm;\n module = WASMAudioDecoderCommon.inflateDynEncodeString(\n wasmString,\n ).then((data) => WebAssembly.compile(data));\n } else {\n module = WebAssembly.compile(decode(wasmString));\n }\n\n WASMAudioDecoderCommon.modules.set(Ref, module);\n }\n\n return module;\n },\n },\n\n concatFloat32: {\n value(buffers, length) {\n let ret = new float32Array(length),\n i = 0,\n offset = 0;\n\n while (i < buffers.length) {\n ret.set(buffers[i], offset);\n offset += buffers[i++].length;\n }\n\n return ret;\n },\n },\n\n getDecodedAudio: {\n value: (errors, channelData, samplesDecoded, sampleRate, bitDepth) => ({\n errors,\n channelData,\n samplesDecoded,\n sampleRate,\n bitDepth,\n }),\n },\n\n getDecodedAudioMultiChannel: {\n value(\n errors,\n input,\n channelsDecoded,\n samplesDecoded,\n sampleRate,\n bitDepth,\n ) {\n let channelData = [],\n i,\n j;\n\n for (i = 0; i < channelsDecoded; i++) {\n const channel = [];\n for (j = 0; j < input.length; ) channel.push(input[j++][i] || []);\n channelData.push(\n WASMAudioDecoderCommon.concatFloat32(channel, samplesDecoded),\n );\n }\n\n return WASMAudioDecoderCommon.getDecodedAudio(\n errors,\n channelData,\n samplesDecoded,\n sampleRate,\n bitDepth,\n );\n },\n },\n\n /*\n ******************\n * Compression Code\n ******************\n */\n\n inflateDynEncodeString: {\n value(source) {\n source = decode(source);\n\n return new Promise((resolve) => {\n // prettier-ignore\n const puffString = String.raw`dynEncode0114db91da9b\u0014u\u0015\u0014\u0014\u0014\u0015*\u0017t\u0016\u0015t\u0018\u0015t\u0017\u0015\u0017\u001a\u0019\u0014\u0015\u0014\u0016\u0015\u0019\u0017\u0015\u0014$\u001a#\u0016\u0015U¤¤\u0018\u001f\u0014U¤¤\u0018\u001f\u001b3\u0017\u001ay\u0016\u0014\u0018zz\u0014\u0018\u001fss|yusvuy\u0017\u0015\u001eÚ&\u0019\u0015\u00184\u0014<\u001605\u00164\u0014<\u0016,5\u0017\u0017T4\u00154\u0016^\u0018T4\u00144\u0014<\u0016(6\u0018U\u0015~J\u0016(4\u00184\u0014<\u0016 ~A\u0014\u00145\u00194\u00144\u0016U\u001c~6\u0018J\u001604\u00174\u00194\u00165\u00174\u00185\u0016 \u0015\u001f\u001f4\u00144\u00164\u0015J\u001604\u00144\u00174\u0015J\u0016,4\u0017U4\u0015U
\u001fÒ\u0016\u0015\u001a7\u0014U45\u001b\u00174\u0018U4Z\u00184\u0017U\u00144\u0017U\u0014^/6\u001c5\u00184\u00165\u0019\u0017T4\u0018\u0018T4\u00144\u0019B\u0015\u0014U\u0015~6\u001a4\u001aC\u0015\u0014U\u0015~O\u0015\u00144\u0018U\u00155\u00184\u0019U\u0016~5\u0019 \u0015\u001f\u001fU\u00145\u001a\u0016T4\u0014B\u0015\u00144\u0017Z!\u00144\u0014U\u0016~5\u0019U\u00145\u0018U\u00155\u001a\u0017T4\u0018U\u0016~6\u0017U4Z\u0018TU\u00145\u0019U\u00165\u0018\u0017T4\u00184\u001b~4\u0019O\u0015\u00144\u0018U2Z\u0018TU\u00145\u0018\u0017T4\u00184\u001cZ!\u00194\u0016B\u0015\u00146\u0014\u0018T4\u001b4\u0014U\u0015~6\u00144\u0014B\u0015\u00146\u0014U\u0015~O\u0015\u00144\u00154\u0014U\u0015~4\u0018O\u0015\u0014\u001f4\u0016U\u0016~5\u00164\u0018U\u0015~5\u0018 \u0014\u001f\u0014\u00194\u00144\u0018~C\u0015\u00144\u0019~5\u00194\u0018U\u0016~5\u0018 \u0015\u001f\u0014\u001f\u0014\u001f4\u00184\u0019~5\u001d4\u00175\u00184\u001aU\u00154\u001dB\u0015\u00146\u001aU\u0014b!\u0014\u001f\u001f4\u001a\u00194\u00144\u0018~U\u0014O\u0015\u00144\u0018U\u0016~5\u0018 \u0015\u001f\u001f\u001f\u0015\u0019U\u00165\u0016\u00174\u0016U4Z\u0018TU#\u001f4\u00184\u0014U\u0015$\u00144\u00176\u00174\u0015<\u0016\u00144\u0016~B\u0015\u00146\u0019^\u00184\u0015<\u0016\u00184\u001a4\u00184\u0017~U\u0015~B\u0015\u0014\u00194\u0016U\u0016~5\u00164\u0017U\u00155\u00174\u00194\u001a~5\u001a4\u00184\u0019~U\u00155\u0018 \u0015\u001f\u001f\u001fµ\u0017\u0015\u0019Uä#U\u0014J\u0016\u0014Uè#5\u0018\u0016T\u0017T4\u0017U0Z\u0018T\u0016TUX5\u0017U\u00155\u0018\u0017T4\u0017\u0018T4\u0017Uà#~4\u0018O\u0015\u0014U\u00154\u0017U $~C\u0015\u00144\u0018~5\u00184\u0017U\u0016~5\u0017 \u0015\u0019\u0017T4\u00144\u0015$\u00166\u0019U\u0014\\!\u001a\u0016T\u0016T\u0016T4\u0019U\u0013\u0015a\u0018T4\u0014<\u0016\u00146\u0017\u0018T4\u0014<\u0016\u001c6\u00184\u0014<\u0016\u0018Z!\u001c4\u00174\u0018~4\u0019N\u0014\u0014\u001f4\u0014<\u0016\u001cU\u0015~5\u001a \u0015\u001f4\u0019U\u0016Z!\u00164\u0019U±\u0016_\u0018TU#\u001f4\u00144\u0019U\u0016U\u00156\u0018UÔ\u001c~B\u0015\u0014$\u00145\u001a4\u00144\u0016$\u00166\u0019U\u0014\\!\u001d4\u0019U\u00156\u0017U¤#~B\u0015\u00144\u00144\u0017Uä#~B\u0015\u0014$\u0014~6\u001b4\u0014<\u0016\u001c6\u0017_\u0018TU#\u001f4\u00174\u001a4\u0018U\u001c~B\u0015\u0014~6\u0018~5\u001a4\u0014<\u0016\u0014Y!\u00144\u001a4\u0014<\u0016\u0018_!\u001a\u0017T4\u0018Y!\u00164\u0014<\u0016\u00146\u001a4\u0017~4\u001a4\u00174\u001b~A\u0014\u0014N\u0014\u00144\u00144\u0014<\u0016\u001cU\u0015~6\u0017J\u0016\u001c4\u0018U\u00155\u0018 \u0014\u001f\u0014\u001f4\u00144\u001aJ\u0016\u001c\u001f4\u0019U\u0016[!\u0015\u001f\u001fU\u0014#\u001f\u0014\u001f\u0014\u001f\u00194\u00184\u0017U\u0015O\u0015\u00144\u0018U\u0016~5\u00184\u0017U\u0015~5\u0017 \u0015\u001f\u001fU\u00155\u0019\u001f4\u0019\u001f\u0013\u001e\u0015 7\u0014U\u0004\u001e6\u00188\u00144\u00184\u0014J\u0016\u00144\u00184\u0016J\u0016 4\u0018U\u0014J\u0016\u001c4\u0018U\u0014J\u001604\u0018V\u0014K\u0016(4\u00184\u0015<\u0016\u0014J\u0016\u00184\u00184\u0017<\u0016\u0014J\u0016$4\u0018U´\u001e~5\u001f4\u0018U\u0004\u001d~5 4\u0018U¤\u001c~5!\u0016T\u0016T\u0017T4\u0018U\u0015$\u00145\"U5\u0014\u0016T\u0016T\u0016T\u0016T\u0016T\u0016T\u0016T4\u0018U\u0016$\u0014\"\u0017\u0014\u0015\u0018\u001c\u001f4\u0018V\u0014K\u0017,U\u00165\u00194\u0018<\u0016(6\u0014U\u0018~6\u00164\u0018<\u0016$6\u001d_!\u001c4\u0018<\u0016 6\u001c4\u0014~6\u001aA\u0014\u00145\u001b4\u001aA\u0014\u00155\u001e4\u00184\u0014U\u0017~6#J\u0016(U5\u00144\u001aA\u0014\u00164\u001bU\u0013\u0015[!\u001b4\u00184\u0016J\u0016(4\u001c4#~A\u0014\u00144\u001eU\u001c6\u001aUU\u001cU\u0013\u0015
[!\u001b4\u001a4\u001b6\u00144\u0016~6\u001b4\u001d_!\u001c4\u0018<\u0016\u001c6\u00194\u0014~5\u001a4\u0018<\u0016\u00146\u001d\u0018T4\u0018<\u0016\u00184\u001a]\u0018TU\u00155\u0019 \u001e\u001f\u0017T4\u0014Y!\u00174\u00194\u001d~4\u00164\u001c~A\u0014\u0014N\u0014\u00144\u0019U\u0015~5\u00194\u0016U\u0015~5\u00164\u0014U\u00155\u0014 \u0014\u001f\u0014\u001f4\u00184\u001bJ\u0016(4\u00184\u001aJ\u0016\u001c \u0016\u001fUÄ\u001dA\u0014\u0014!\u0017U\u00145\u0016U#Uô\u001dJ\u0016\u0014U\u0010\"UÔ\u001dJ\u0016\u0014U#UÔ\"J\u0016\u0014U#U´\"J\u0016\u0014\u0017T4\u0016U´\u0016Z\u0018TU\u00145\u0016\u0017T4\u0016Uô\u0015Z\u0018TU\u00145\u0016\u0017T4\u0016UDZ\u0018TU\u00145\u0016\u0017T4\u0016U$[\u0018T4\u00164\u001f~U\u001cO\u0015\u00144\u0016U\u0016~5\u0016 \u0015\u001f\u001fUÔ\u001dUô\u001d4\u0018U\u0004\u0019~U´\u0016$\u0015.U\u00145\u0016\u0017T4\u0016UP[\u0018T4\u0018U\u0004\u0019~4\u0016~U\u0019O\u0015\u00144\u0016U\u0016~5\u0016 \u0015\u001f\u001fU#<\u0016\u0014U#<\u0016\u00144\u0018U\u0004\u0019~U2$\u0015.UÄ\u001dU\u0015N\u0014\u0014 \u001d\u00194\u00164 ~U\u001bO\u0015\u00144\u0016U\u0016~5\u0016 \u0015\u001f\u0014\u001f\u0014\u00194\u00164!~U\u001dO\u0015\u00144\u0016U\u0016~5\u0016 \u0015\u001f\u0014\u001f\u0014\u00194\u0018U\u0004\u0019~4\u0016~U\u001cO\u0015\u00144\u0016U\u0016~5\u0016 \u0015\u001f\u0014\u001f\u0014\u001f4\u00184\u0019J\u0016\u001c4\u00184\u0016J\u0016(\u001fU\u00145\u0014 \u0016\u001f4\u00184\u0018U¤\u0015~J\u0016@4\u00184\u0018Uä\u0019~J\u0016<4\u00184\u0018UD~J\u001684\u00184\u0018U\u0004\u0014~J\u001644\u0018U\u0019$\u00145\u00164\u0018U\u0019$\u00145\u0019U5\u00144\u0018U\u0018$\u00145\u001b4\u0016U1^4\u0019U1^!\u00154\u0016U\u0016~5\u001c4\u0019U\u0015~5\u001aU\u001d5\u00144\u001bU\u0018~6\u0016U\u00144\u0016U\u0014^/6\u00195\u0016\u0017T4\u0016\u0018T4\u0018U\u0017$\u00145\u001b4\u0018U\u0004\u0019~4\u0014B\u0015\u0014U\u0015~4\u001bO\u0015\u00144\u0016U\u00155\u00164\u0014U\u0016~5\u0014 \u0015\u0019U\u0014U'4\u00196\u00144\u0014U'_/5\u00164\u0019U\u0015U\u001d~5\u0014\u0017T4\u0016\u0018T4\u0018U\u0004\u0019~4\u0014B\u0015\u0014U\u0015~U\u0014O\u0015\u00144\u0016U\u00155\u00164\u0014U\u0016~5\u0014 \u0015\u001f\u001fU5\u00144\u0018Uä\u0019~4\u0018U¤\u0015~4\u0018U\u0004\u0019~U'$\u0015!\u00174\u001a4\u001c~5\u001bU\u00145\u0019\u0017T4\u00194\u001b\\\u0018T4\u00184\u0018U<~$\u00166\u0014U\u0014\\!\u00194\u0014U#a\u0018T4\u0018U\u0004\u0019~4\u0019U\u0015~4\u0014O\u0015\u00144\u0019U\u0015~5\u0019 \u0016\u001fU\u00145\u001dU\u00175\u001eU\u00175\u0016\u0016T\u0016T\u0016T4\u0014U$\"\u0016\u0014\u0016\u0015\u001f4\u0019Y\u0018TU5\u0014 \u001c\u001f4\u0019U\u00154\u0018~C\u0015\u0002\u00195\u001dU\u00165\u0016 \u0015\u001fU\u001f5\u001eU\u001b5\u0016\u001f4\u001b4\u00184\u0016$\u00144\u001e~6\u00164\u0019~\\\u0018TU5\u0014 \u001a\u001f4\u0018U\u0004\u0019~4\u0019U\u0015~5\u0014\u0017T4\u0016Y!\u00164\u00144\u001dO\u0015\u00144\u0014U\u0016~5\u00144\u0019U\u0015~5\u00194\u0016U\u00155\u0016 \u0014\u001f\u0014\u001f\u001f4\u0018C\u0015\u0004\u001dY\u0018TU5\u0014 \u0018\u001f4\u0018Uä\u0019~4\u0018U¤\u0015~4\u0018U\u0004\u0019~4\u001c$\u00156\u0016\u0018TU5\u00144\u0016U\u0014\\!\u00184\u001c4\u0018B\u0015æ\u00194\u0018B\u0015ä\u0019~[!\u0018\u001f4\u0018U\u0004\u0014~4\u0018UD~4\u0018U\u0004\u0019~4\u001cU\u0015~4\u001a$\u00156\u0016\u0018TU5\u00144\u0016U\u0014\\!\u00184\u001a4\u0018B\u00154\u0018B\u0015~[!\u0018\u001f4\u00184\u0018U<~4\u0018U4~$\u00175\u0014 \u0017\u001f\u0014\u001f\u0014\u001f4\u0018U\u0010\"U#$\u00175\u0014\u001f4\u00144\"Y!\u0014\u001f4\u00145\u00194\u0014U\u0014^!\u0015\u001f4\u00154\u0018<\u0016\u001cJ\u0016\u00144\u00174\u0018<\u0016(J\u0016\u00144\u00145\u0019\u001f4\u0018U\u0004\u001e~8\u00144\u0019\u001f\u001f\u0015\u0017\u0014U\u001c\u001fN\u0017\u0014\u0018\u0014\u0019\u0014\u001a\u0014\u001b\u0014\u001c\u0014\u001d\u0014\u001e\u0014\u001f\u0014!\u0014#\u0014%\u0014'\u0014+\u0014/\u00143\u00147\u0014?\u0014G\u0014O\u0014W\u0014g\u0014w\u0014\u0014\u0014·\u0014×\u0014÷\u0014\u0016\u0015\u0014Uä\u001c\u001f;\u0015\u0014\u0015\u0014\u0015\u0014\u0015\u0014\u0016\u0014\u0016\u0014\u0016\u0014\u0016\u0014\u0017\u0014\u0017\u0014\u0017\u0014\u0017\u0014\u0018\u0014\u0018\u0014\u0018\u0014\u0018\u0014\u0019\u0014\u0019\u0014\u0019\u0014\u0019\u0014U\u001d\u001f9$\u0014%\u0014&\u0014\u0014\u0014\u001c\u0014\u001b\u0014\u001d\u0014\u001a\u0014\u001e\u0014\u0019\u0014\u001f\u0014\u0018\u0014 \u0014\u0017\u0014!\u0014\u0016\u0014\"\u0014\u0015\u0014#`;\n\n WASMAudioDecoderCommon.getModule(WASMAudioDecoderCommon, puffString)\n .then((wasm) => WebAssembly.instantiate(wasm, {}))\n .then(({ exports }) => {\n // required for minifiers that mangle the __heap_base property\n const instanceExports = new Map(Object.entries(exports));\n\n const puff = instanceExports.get(\"puff\");\n const memory = instanceExports.get(\"memory\")[\"buffer\"];\n const dataArray = new uint8Array(memory);\n const heapView = new DataView(memory);\n\n let heapPos = instanceExports.get(\"__heap_base\");\n\n // source length\n const sourceLength = source.length;\n const sourceLengthPtr = heapPos;\n heapPos += 4;\n heapView.setInt32(sourceLengthPtr, sourceLength, true);\n\n // source data\n const sourcePtr = heapPos;\n heapPos += sourceLength;\n dataArray.set(source, sourcePtr);\n\n // destination length\n const destLengthPtr = heapPos;\n heapPos += 4;\n heapView.setInt32(\n destLengthPtr,\n dataArray.byteLength - heapPos,\n true,\n );\n\n // destination data fills in the rest of the heap\n puff(heapPos, destLengthPtr, sourcePtr, sourceLengthPtr);\n\n resolve(\n dataArray.slice(\n heapPos,\n heapPos + heapView.getInt32(destLengthPtr, true),\n ),\n );\n });\n });\n },\n },\n });\n }\n\n Object.defineProperty(this, \"wasm\", {\n enumerable: true,\n get: () => this._wasm,\n });\n\n this.getOutputChannels = (outputData, channelsDecoded, samplesDecoded) => {\n let output = [],\n i = 0;\n\n while (i < channelsDecoded)\n output.push(\n outputData.slice(\n i * samplesDecoded,\n i++ * samplesDecoded + samplesDecoded,\n ),\n );\n\n return output;\n };\n\n this.allocateTypedArray = (len, TypedArray, setPointer = true) => {\n const ptr = this._wasm.malloc(TypedArray.BYTES_PER_ELEMENT * len);\n if (setPointer) this._pointers.add(ptr);\n\n return {\n ptr: ptr,\n len: len,\n buf: new TypedArray(this._wasm.HEAP, ptr, len),\n };\n };\n\n this.free = () => {\n this._pointers.forEach((ptr) => {\n this._wasm.free(ptr);\n });\n this._pointers.clear();\n };\n\n this.codeToString = (ptr) => {\n const characters = [],\n heap = new Uint8Array(this._wasm.HEAP);\n for (let character = heap[ptr]; character !== 0; character = heap[++ptr])\n characters.push(character);\n\n return String.fromCharCode.apply(null, characters);\n };\n\n this.addError = (\n errors,\n message,\n frameLength,\n frameNumber,\n inputBytes,\n outputSamples,\n ) => {\n errors.push({\n message: message,\n frameLength: frameLength,\n frameNumber: frameNumber,\n inputBytes: inputBytes,\n outputSamples: outputSamples,\n });\n };\n\n this.instantiate = (_EmscriptenWASM, _module) => {\n if (_module) WASMAudioDecoderCommon.setModule(_EmscriptenWASM, _module);\n this._wasm = new _EmscriptenWASM(WASMAudioDecoderCommon).instantiate();\n this._pointers = new Set();\n\n return this._wasm.ready.then(() => this);\n };\n}\n","import NodeWorker from \"@eshaz/web-worker\";\nimport WASMAudioDecoderCommon from \"./WASMAudioDecoderCommon.js\";\n\nconst getWorker = () => globalThis.Worker || NodeWorker;\n\nexport default class WASMAudioDecoderWorker extends getWorker() {\n constructor(options, name, Decoder, EmscriptenWASM) {\n if (!WASMAudioDecoderCommon.modules) new WASMAudioDecoderCommon();\n\n let source = WASMAudioDecoderCommon.modules.get(Decoder);\n\n if (!source) {\n let type = \"text/javascript\",\n isNode,\n webworkerSourceCode =\n \"'use strict';\" +\n // dependencies need to be manually resolved when stringifying this function\n `(${((_Decoder, _WASMAudioDecoderCommon, _EmscriptenWASM) => {\n // We're in a Web Worker\n\n // setup Promise that will be resolved once the WebAssembly Module is received\n let decoder,\n moduleResolve,\n modulePromise = new Promise((resolve) => {\n moduleResolve = resolve;\n });\n\n self.onmessage = ({ data: { id, command, data } }) => {\n let messagePromise = modulePromise,\n messagePayload = { id },\n transferList;\n\n if (command === \"init\") {\n Object.defineProperties(_Decoder, {\n WASMAudioDecoderCommon: { value: _WASMAudioDecoderCommon },\n EmscriptenWASM: { value: _EmscriptenWASM },\n module: { value: data.module },\n isWebWorker: { value: true },\n });\n\n decoder = new _Decoder(data.options);\n moduleResolve();\n } else if (command === \"free\") {\n decoder.free();\n } else if (command === \"ready\") {\n messagePromise = messagePromise.then(() => decoder.ready);\n } else if (command === \"reset\") {\n messagePromise = messagePromise.then(() => decoder.reset());\n } else {\n // \"decode\":\n // \"decodeFrame\":\n // \"decodeFrames\":\n Object.assign(\n messagePayload,\n decoder[command](\n // detach buffers\n Array.isArray(data)\n ? data.map((data) => new Uint8Array(data))\n : new Uint8Array(data),\n ),\n );\n // The \"transferList\" parameter transfers ownership of channel data to main thread,\n // which avoids copying memory.\n transferList = messagePayload.channelData\n ? messagePayload.channelData.map((channel) => channel.buffer)\n : [];\n }\n\n messagePromise.then(() =>\n self.postMessage(messagePayload, transferList),\n );\n };\n }).toString()})(${Decoder}, ${WASMAudioDecoderCommon}, ${EmscriptenWASM})`;\n\n try {\n isNode = typeof process.versions.node !== \"undefined\";\n } catch {}\n\n source = isNode\n ? `data:${type};base64,${Buffer.from(webworkerSourceCode).toString(\n \"base64\",\n )}`\n : URL.createObjectURL(new Blob([webworkerSourceCode], { type }));\n\n WASMAudioDecoderCommon.modules.set(Decoder, source);\n }\n\n super(source, { name });\n\n this._id = Number.MIN_SAFE_INTEGER;\n this._enqueuedOperations = new Map();\n\n this.onmessage = ({ data }) => {\n const { id, ...rest } = data;\n this._enqueuedOperations.get(id)(rest);\n this._enqueuedOperations.delete(id);\n };\n\n new EmscriptenWASM(WASMAudioDecoderCommon).getModule().then((module) => {\n this.postToDecoder(\"init\", { module, options });\n });\n }\n\n async postToDecoder(command, data) {\n return new Promise((resolve) => {\n this.postMessage({\n command,\n id: this._id,\n data,\n });\n\n this._enqueuedOperations.set(this._id++, resolve);\n });\n }\n\n get ready() {\n return this.postToDecoder(\"ready\");\n }\n\n async free() {\n await this.postToDecoder(\"free\").finally(() => {\n this.terminate();\n });\n }\n\n async reset() {\n await this.postToDecoder(\"reset\");\n }\n}\n","export const assignNames = (Class, name) => {\n Object.defineProperty(Class, \"name\", { value: name });\n};\n"],"names":["WASMAudioDecoderCommon","uint8Array","Uint8Array","float32Array","Float32Array","modules","Object","defineProperties","value","WeakMap","setModule","Ref","module","set","Promise","resolve","getModule","wasmString","get","WebAssembly","compile","wasm","inflateDynEncodeString","then","data","concatFloat32","buffers","length","ret","i","offset","getDecodedAudio","errors","channelData","samplesDecoded","sampleRate","bitDepth","getDecodedAudioMultiChannel","input","channelsDecoded","j","channel","push","source","puffString","String","raw","instantiate","exports","instanceExports","Map","entries","puff","memory","dataArray","heapView","DataView","heapPos","sourceLength","sourceLengthPtr","setInt32","sourcePtr","destLengthPtr","byteLength","slice","getInt32","defineProperty","this","enumerable","_wasm","getOutputChannels","outputData","output","allocateTypedArray","len","TypedArray","setPointer","ptr","malloc","BYTES_PER_ELEMENT","_pointers","add","buf","HEAP","free","forEach","clear","codeToString","characters","heap","character","fromCharCode","apply","addError","message","frameLength","frameNumber","inputBytes","outputSamples","_EmscriptenWASM","_module","Set","ready","WASMAudioDecoderWorker","globalThis","Worker","getWorker","constructor","options","name","Decoder","EmscriptenWASM","isNode","type","webworkerSourceCode","_Decoder","_WASMAudioDecoderCommon","decoder","moduleResolve","modulePromise","self","onmessage","id","command","transferList","messagePromise","messagePayload","isWebWorker","reset","assign","Array","isArray","map","buffer","postMessage","toString","process","versions","node","Buffer","from","URL","createObjectURL","Blob","super","_id","Number","MIN_SAFE_INTEGER","_enqueuedOperations","rest","delete","postToDecoder","finally","terminate","assignNames","Class"],"sourceRoot":""} |