@openclaw/whatsapp 2026.9.5 → 2026.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/icon.png +0 -0
- package/dist/.setup/{accounts-D_NGDjCx.mjs → accounts-CtRPAQCL.mjs} +3 -9
- package/dist/.setup/{action-runtime-DZZFamfl.mjs → action-runtime-DeVk5V7r.mjs} +2 -2
- package/dist/.setup/{agent-tools-login-B6MAs75N.mjs → agent-tools-login-CL5C1rA2.mjs} +5 -1
- package/dist/.setup/{approval-handler.runtime-C0hzmMSj.mjs → approval-handler.runtime-CjqMlPOX.mjs} +6 -26
- package/dist/.setup/{approval-reactions-BnXw-UZI.mjs → approval-reactions-DiOFvb1s.mjs} +8 -14
- package/dist/.setup/{auth-store-Dh8a3cba.mjs → auth-store-BBonwKks.mjs} +9 -33
- package/dist/.setup/{channel-CSclZYjU.mjs → channel-CJFE0kD_.mjs} +82 -154
- package/dist/.setup/{channel-react-action-1iBiEnq7.mjs → channel-react-action-2r_hjLZV.mjs} +4 -8
- package/dist/.setup/{channel.runtime-ddGY37w8.mjs → channel.runtime-C94goLw9.mjs} +4 -4
- package/dist/.setup/{channel.setup-CqUl8COe.mjs → channel.setup-CfN1UfdY.mjs} +1 -1
- package/dist/.setup/{connection-controller-C60mU7j7.mjs → connection-controller-CHo1oRJA.mjs} +13 -63
- package/dist/.setup/{creds-files-Drg3usj1.mjs → creds-files-CDATZWWM.mjs} +5 -11
- package/dist/.setup/{directory-config-BHPoBklt.mjs → directory-config-DUiJ5d8I.mjs} +13 -14
- package/dist/.setup/doctor-iMwg0Vhr.mjs +222 -0
- package/dist/.setup/group-config-path-DZr3ucUO.mjs +40 -0
- package/dist/.setup/{group-session-key-D22hYMdE.mjs → group-session-key-2-mja4OF.mjs} +3 -9
- package/dist/.setup/{login-2dmd1TfE.mjs → login-BFlvSh9h.mjs} +9 -11
- package/dist/.setup/{login-qr-CgKtO_ef.mjs → login-qr-Ayb8i25J.mjs} +29 -77
- package/dist/.setup/{monitor-BblvzLpX.mjs → monitor-CGpV2VNN.mjs} +391 -509
- package/dist/.setup/{question-reactions-D3Zq9Gbn.mjs → question-reactions-CPyyi5AY.mjs} +2 -2
- package/dist/.setup/rolldown-runtime-BBjsoOtd.mjs +27 -0
- package/dist/.setup/{send-C6jDmcL9.mjs → send-BGdvf5cC.mjs} +31 -80
- package/dist/.setup/{send-api-B4DOt2RJ.mjs → send-api-H4AkQJjT.mjs} +45 -109
- package/dist/.setup/{session-errors-JuazczrA.mjs → session-errors-B8UcAnZN.mjs} +1 -4
- package/dist/.setup/{session.runtime-DcJuO42v.mjs → session.runtime-st1konFI.mjs} +1 -1
- package/dist/.setup/{setup-finalize-BYEgU0hb.mjs → setup-finalize-DmPX4EaW.mjs} +32 -70
- package/dist/.setup/setup-plugin-api-vJlxKzca.mjs +3 -0
- package/dist/.setup/{setup-surface-Cd3wN5HD.mjs → setup-surface-43fj197P.mjs} +3 -3
- package/dist/.setup/{shared-C9OEtKgc.mjs → shared-DgOG5Iqr.mjs} +26 -37
- package/dist/.setup/{socket-close-CCVSFufF.mjs → socket-close-CT__V2fz.mjs} +80 -92
- package/dist/.setup/{targets-runtime-RBjx3pg_.mjs → targets-runtime-DmiqXIXO.mjs} +2 -7
- package/dist/action-runtime-api.js +1 -1
- package/dist/action-runtime.runtime.js +1 -1
- package/dist/agent-tools-api.js +6 -13
- package/dist/api.js +10 -10
- package/dist/auth-presence.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +9 -10
- package/dist/light-runtime-api.js +3 -3
- package/dist/login-qr-runtime.js +1 -1
- package/dist/runtime-api.js +10 -10
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/audio-decode/LICENSE +9 -10
- package/node_modules/audio-decode/README.md +16 -0
- package/node_modules/audio-decode/audio-decode.d.ts +2 -14
- package/node_modules/audio-decode/audio-decode.js +4 -92
- package/node_modules/audio-decode/meta.js +1 -0
- package/node_modules/audio-decode/node_modules/{audio-buffer → @audio/decode}/LICENSE +1 -1
- package/node_modules/audio-decode/node_modules/@audio/decode/audio-decode.d.ts +52 -0
- package/node_modules/audio-decode/node_modules/@audio/decode/audio-decode.js +242 -0
- package/node_modules/audio-decode/node_modules/@audio/decode/meta.js +14 -0
- package/node_modules/audio-decode/node_modules/@audio/decode/package.json +114 -0
- package/node_modules/audio-decode/node_modules/@audio/decode/readme.md +191 -0
- package/node_modules/audio-decode/node_modules/@audio/decode/stream.d.ts +12 -0
- package/node_modules/audio-decode/node_modules/@audio/decode/stream.js +1 -0
- package/node_modules/audio-decode/node_modules/@audio/decode/test.html +52 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/LICENSE +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/README.md +80 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/alac.js +326 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/decode-aac.d.ts +24 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/decode-aac.js +452 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/meta.js +81 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/package.json +63 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/src/aac.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/LICENSE +12 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/LICENSE.liba52 +340 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/README.md +41 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/decode-ac3.d.ts +20 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/decode-ac3.js +131 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/package.json +64 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/src/ac3.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aiff/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aiff/README.md +46 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aiff/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aiff/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aiff/decode-aiff.d.ts +16 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aiff/decode-aiff.js +583 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aiff/package.json +52 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/LICENSE +191 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/README.md +65 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/decode-amr.d.ts +16 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/decode-amr.js +150 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/package.json +58 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/src/amr.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-avi/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-avi/README.md +53 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-avi/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-avi/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-avi/decode-avi.d.ts +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-avi/decode-avi.js +241 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-avi/package.json +66 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-caf/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-caf/README.md +48 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-caf/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-caf/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-caf/decode-caf.d.ts +16 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-caf/decode-caf.js +238 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-caf/package.json +53 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/README.md +73 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/audio.d.ts +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/audio.js +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/decode-dsd.d.ts +29 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/decode-dsd.js +423 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/meta.js +40 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/package.json +64 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/LICENSE +12 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/LICENSE.libdca +339 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/README.md +41 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/decode-dts.d.ts +20 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/decode-dts.js +139 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/package.json +64 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/src/dts.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/LICENSE +12 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/LICENSE.ffmpeg +502 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/README.md +45 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/decode-eac3.d.ts +20 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/decode-eac3.js +124 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/package.json +68 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/src/eac3.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/LICENSE +25 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/README.md +23 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/decode-flac.d.ts +18 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/decode-flac.js +3172 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/meta.js +115 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/package.json +60 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/LICENSE +23 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/LICENSE.libopenmpt +25 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/README.md +86 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/audio.d.ts +20 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/audio.js +12 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/decode-mod.d.ts +58 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/decode-mod.js +148 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/package.json +68 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/src/mod.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/LICENSE +25 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/README.md +20 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/decode-mp3.d.ts +16 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/decode-mp3.js +793 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/meta.js +143 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/package.json +60 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp4/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp4/README.md +58 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp4/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp4/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp4/decode-mp4.d.ts +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp4/decode-mp4.js +455 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp4/package.json +74 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/LICENSE +31 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/LICENSE.libmpcdec +31 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/README.md +60 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/decode-mpc.d.ts +20 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/decode-mpc.js +158 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/package.json +64 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/src/mpc.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/LICENSE +25 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/LICENSE.libopus +44 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/README.md +32 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/core.d.ts +33 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/core.js +147 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/decode-opus.d.ts +18 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/decode-opus.js +1 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/meta.js +103 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/package.json +68 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/src/decode-opus.js +2 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/src/opus.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-qoa/LICENSE +25 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-qoa/README.md +19 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-qoa/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-qoa/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-qoa/decode-qoa.d.ts +16 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-qoa/decode-qoa.js +275 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-qoa/package.json +56 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/LICENSE.ttadec +39 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/README.md +58 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/decode-tta.d.ts +17 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/decode-tta.js +302 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/package.json +58 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/LICENSE +25 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/README.md +33 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/decode-vorbis.d.ts +18 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/decode-vorbis.js +2984 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/meta.js +102 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/package.json +60 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/README.md +23 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/decode-wav.d.ts +8 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/decode-wav.js +256 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/meta.js +114 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/package.json +52 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/LICENSE +29 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/LICENSE.wavpack +25 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/README.md +41 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/decode-wavpack.d.ts +18 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/decode-wavpack.js +140 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/package.json +62 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/src/wavpack.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/LICENSE.libopus +44 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/README.md +59 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/decode-webm.d.ts +18 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/decode-webm.js +141 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/package.json +76 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/src/opus.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/LICENSE +12 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/README.md +74 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/decode-wma.d.ts +33 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/decode-wma.js +516 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/package.json +57 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/src/wma.wasm.js +0 -0
- package/node_modules/audio-decode/package.json +37 -39
- package/node_modules/audio-decode/stream.d.ts +2 -0
- package/node_modules/audio-decode/stream.js +2 -0
- package/node_modules/baileys/lib/Utils/messages-media.js +1 -1
- package/node_modules/baileys/node_modules/file-type/package.json +3 -2
- package/node_modules/baileys/node_modules/file-type/readme.md +5 -0
- package/node_modules/baileys/node_modules/file-type/source/detectors/zip.js +9 -4
- package/node_modules/baileys/node_modules/file-type/source/index.js +28 -1
- package/node_modules/baileys/node_modules/file-type/source/supported.js +2 -0
- package/node_modules/baileys/node_modules/p-timeout/index.js +3 -0
- package/node_modules/baileys/node_modules/p-timeout/package.json +1 -1
- package/node_modules/baileys/package.json +1 -1
- package/node_modules/typebox/build/compile/code.mjs +1 -2
- package/node_modules/typebox/build/compile/validator.mjs +5 -1
- package/node_modules/typebox/build/format/iri.mjs +16 -9
- package/node_modules/typebox/build/guard/emit.mjs +2 -2
- package/node_modules/typebox/build/guard/guard.d.mts +7 -5
- package/node_modules/typebox/build/guard/guard.mjs +14 -9
- package/node_modules/typebox/build/guard/index.mjs +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
- package/node_modules/typebox/build/guard/{string.mjs → unicode/unicode_segment.mjs} +16 -19
- package/node_modules/typebox/build/schema/build.mjs +2 -3
- package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
- package/node_modules/typebox/build/schema/engine/_refine.mjs +13 -5
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/format.mjs +9 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/properties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/ref.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/schema.mjs +24 -24
- package/node_modules/typebox/build/schema/parse.mjs +3 -0
- package/node_modules/typebox/build/schema/pointer/pointer.d.mts +1 -6
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +47 -64
- package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
- package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
- package/node_modules/typebox/build/system/settings/settings.d.mts +11 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +14 -0
- package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
- package/node_modules/typebox/build/type/extends/inference.mjs +15 -2
- package/node_modules/typebox/build/type/extends/tuple.d.mts +2 -1
- package/node_modules/typebox/build/type/extends/tuple.mjs +21 -1
- package/node_modules/typebox/build/value/parse/parse.mjs +10 -4
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +3 -1
- package/package.json +6 -6
- package/dist/.setup/doctor-BPb-SjdE.mjs +0 -65
- package/dist/.setup/group-config-path-BGyzT9Lg.mjs +0 -54
- package/dist/.setup/normalize-DdsROMMa.mjs +0 -2
- package/dist/.setup/rolldown-runtime-D7D4PA-g.mjs +0 -13
- package/dist/.setup/runtime-group-policy-DeSRFXEV.mjs +0 -11
- package/dist/.setup/setup-plugin-api-CXfU-7vN.mjs +0 -3
- package/dist/.setup/text-runtime-CHl0iPYe.mjs +0 -4
- package/node_modules/audio-decode/.eslintrc.json +0 -43
- package/node_modules/audio-decode/.github/workflows/test.js.yml +0 -31
- package/node_modules/audio-decode/.travis.yml +0 -13
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/README.md +0 -293
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/dist/opus-ml-decoder.min.js +0 -11646
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/dist/opus-ml-decoder.min.js.map +0 -1
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/index.js +0 -8
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/package.json +0 -58
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/src/EmscriptenWasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/src/OpusMLDecoder.js +0 -253
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/src/OpusMLDecoderWebWorker.js +0 -17
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/types.d.ts +0 -77
- package/node_modules/audio-decode/node_modules/audio-buffer/.eslintrc.json +0 -44
- package/node_modules/audio-decode/node_modules/audio-buffer/.github/workflows/node.js.yml +0 -31
- package/node_modules/audio-decode/node_modules/audio-buffer/.travis.yml +0 -7
- package/node_modules/audio-decode/node_modules/audio-buffer/index.js +0 -76
- package/node_modules/audio-decode/node_modules/audio-buffer/package.json +0 -37
- package/node_modules/audio-decode/node_modules/audio-buffer/readme.md +0 -56
- package/node_modules/audio-decode/node_modules/node-wav/README.md +0 -35
- package/node_modules/audio-decode/node_modules/node-wav/file.wav +0 -0
- package/node_modules/audio-decode/node_modules/node-wav/index.js +0 -291
- package/node_modules/audio-decode/node_modules/node-wav/package.json +0 -29
- package/node_modules/audio-decode/node_modules/node-wav/tests/file1.wav +0 -0
- package/node_modules/audio-decode/node_modules/node-wav/tests/test.js +0 -66
- package/node_modules/audio-decode/node_modules/node-wav/x.js +0 -12
- package/node_modules/audio-decode/node_modules/node-wav/x.json +0 -86702
- package/node_modules/audio-decode/node_modules/node-wav/x.js~ +0 -13
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/README.md +0 -320
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.min.js +0 -232
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.min.js.map +0 -1
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.opus-ml.min.js +0 -0
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.opus-ml.min.js.map +0 -1
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/index.js +0 -8
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/package.json +0 -74
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/src/OggOpusDecoder.js +0 -226
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/src/OggOpusDecoderWebWorker.js +0 -17
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/types.d.ts +0 -37
- package/node_modules/audio-decode/node_modules/opus-decoder/README.md +0 -265
- package/node_modules/audio-decode/node_modules/opus-decoder/dist/opus-decoder.min.js +0 -232
- package/node_modules/audio-decode/node_modules/opus-decoder/dist/opus-decoder.min.js.map +0 -1
- package/node_modules/audio-decode/node_modules/opus-decoder/index.js +0 -8
- package/node_modules/audio-decode/node_modules/opus-decoder/package.json +0 -56
- package/node_modules/audio-decode/node_modules/opus-decoder/src/EmscriptenWasm.js +0 -0
- package/node_modules/audio-decode/node_modules/opus-decoder/src/OpusDecoder.js +0 -239
- package/node_modules/audio-decode/node_modules/opus-decoder/src/OpusDecoderWebWorker.js +0 -17
- package/node_modules/audio-decode/node_modules/opus-decoder/types.d.ts +0 -74
- package/node_modules/audio-decode/readme.md +0 -49
- package/node_modules/audio-decode/tea.yaml +0 -6
- package/node_modules/audio-decode/test-case.js +0 -11
- package/node_modules/audio-decode/test.html +0 -15
- package/node_modules/audio-decode/test.js +0 -107
- /package/node_modules/typebox/build/guard/{string.d.mts → unicode/unicode_segment.d.mts} +0 -0
|
@@ -0,0 +1,3172 @@
|
|
|
1
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
+
var __esm = (fn, res) => function __init() {
|
|
3
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
// ../_build/text-decoder.js
|
|
7
|
+
var TextDecoder;
|
|
8
|
+
var init_text_decoder = __esm({
|
|
9
|
+
"../_build/text-decoder.js"() {
|
|
10
|
+
TextDecoder = globalThis.TextDecoder ?? class {
|
|
11
|
+
decode(u8) {
|
|
12
|
+
let s = "", i = 0;
|
|
13
|
+
while (i < u8.length) {
|
|
14
|
+
let b = u8[i++], c = b;
|
|
15
|
+
if (b > 127) {
|
|
16
|
+
let n = b > 239 ? 3 : b > 223 ? 2 : 1;
|
|
17
|
+
for (c = b & 63 >> n; n--; ) c = c << 6 | u8[i++] & 63;
|
|
18
|
+
}
|
|
19
|
+
if (c > 65535) c -= 65536, s += String.fromCharCode(55296 | c >> 10, 56320 | c & 1023);
|
|
20
|
+
else s += String.fromCharCode(c);
|
|
21
|
+
}
|
|
22
|
+
return s;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// src/decode-flac.src.js
|
|
29
|
+
init_text_decoder();
|
|
30
|
+
|
|
31
|
+
// ../../node_modules/@wasm-audio-decoders/flac/src/FLACDecoder.js
|
|
32
|
+
init_text_decoder();
|
|
33
|
+
|
|
34
|
+
// ../../node_modules/@wasm-audio-decoders/common/index.js
|
|
35
|
+
init_text_decoder();
|
|
36
|
+
|
|
37
|
+
// ../../node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderCommon.js
|
|
38
|
+
init_text_decoder();
|
|
39
|
+
|
|
40
|
+
// ../../node_modules/simple-yenc/dist/esm.js
|
|
41
|
+
init_text_decoder();
|
|
42
|
+
var t = (t2, n = 4294967295, e2 = 79764919) => {
|
|
43
|
+
const r = new Int32Array(256);
|
|
44
|
+
let o, s, i, c = n;
|
|
45
|
+
for (o = 0; o < 256; o++) {
|
|
46
|
+
for (i = o << 24, s = 8; s > 0; --s) i = 2147483648 & i ? i << 1 ^ e2 : i << 1;
|
|
47
|
+
r[o] = i;
|
|
48
|
+
}
|
|
49
|
+
for (o = 0; o < t2.length; o++) c = c << 8 ^ r[255 & (c >> 24 ^ t2[o])];
|
|
50
|
+
return c;
|
|
51
|
+
};
|
|
52
|
+
var e = (n, e2 = t) => {
|
|
53
|
+
const r = (t2) => new Uint8Array(t2.length / 2).map(((n2, e3) => parseInt(t2.substring(2 * e3, 2 * (e3 + 1)), 16))), o = (t2) => r(t2)[0], s = /* @__PURE__ */ new Map();
|
|
54
|
+
[, 8364, , 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 352, 8249, 338, , 381, , , 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 353, 8250, 339, , 382, 376].forEach(((t2, n2) => s.set(t2, n2)));
|
|
55
|
+
const i = new Uint8Array(n.length);
|
|
56
|
+
let c, a, l, f = false, g = 0, h = 42, p = n.length > 13 && "dynEncode" === n.substring(0, 9), u = 0;
|
|
57
|
+
p && (u = 11, a = o(n.substring(9, u)), a <= 1 && (u += 2, h = o(n.substring(11, u))), 1 === a && (u += 8, l = ((t2) => new DataView(r(t2).buffer).getInt32(0, true))(n.substring(13, u))));
|
|
58
|
+
const d = 256 - h;
|
|
59
|
+
for (let t2 = u; t2 < n.length; t2++) if (c = n.charCodeAt(t2), 61 !== c || f) {
|
|
60
|
+
if (92 === c && t2 < n.length - 5 && p) {
|
|
61
|
+
const e3 = n.charCodeAt(t2 + 1);
|
|
62
|
+
117 !== e3 && 85 !== e3 || (c = parseInt(n.substring(t2 + 2, t2 + 6), 16), t2 += 5);
|
|
63
|
+
}
|
|
64
|
+
if (c > 255) {
|
|
65
|
+
const t3 = s.get(c);
|
|
66
|
+
t3 && (c = t3 + 127);
|
|
67
|
+
}
|
|
68
|
+
f && (f = false, c -= 64), i[g++] = c < h && c > 0 ? c + d : c - h;
|
|
69
|
+
} else f = true;
|
|
70
|
+
const m = i.subarray(0, g);
|
|
71
|
+
if (p && 1 === a) {
|
|
72
|
+
const t2 = e2(m);
|
|
73
|
+
if (t2 !== l) {
|
|
74
|
+
const n2 = "Decode failed crc32 validation";
|
|
75
|
+
throw console.error("`simple-yenc`\n", n2 + "\n", "Expected: " + l + "; Got: " + t2 + "\n", "Visit https://github.com/eshaz/simple-yenc for more information"), Error(n2);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return m;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// ../../node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderCommon.js
|
|
82
|
+
function WASMAudioDecoderCommon() {
|
|
83
|
+
const uint8Array2 = Uint8Array;
|
|
84
|
+
const float32Array = Float32Array;
|
|
85
|
+
if (!WASMAudioDecoderCommon.modules) {
|
|
86
|
+
Object.defineProperties(WASMAudioDecoderCommon, {
|
|
87
|
+
modules: {
|
|
88
|
+
value: /* @__PURE__ */ new WeakMap()
|
|
89
|
+
},
|
|
90
|
+
setModule: {
|
|
91
|
+
value(Ref, module) {
|
|
92
|
+
WASMAudioDecoderCommon.modules.set(Ref, Promise.resolve(module));
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
getModule: {
|
|
96
|
+
value(Ref, wasmString) {
|
|
97
|
+
let module = WASMAudioDecoderCommon.modules.get(Ref);
|
|
98
|
+
if (!module) {
|
|
99
|
+
if (!wasmString) {
|
|
100
|
+
wasmString = Ref.wasm;
|
|
101
|
+
module = WASMAudioDecoderCommon.inflateDynEncodeString(
|
|
102
|
+
wasmString
|
|
103
|
+
).then((data3) => WebAssembly.compile(data3));
|
|
104
|
+
} else {
|
|
105
|
+
module = WebAssembly.compile(e(wasmString));
|
|
106
|
+
}
|
|
107
|
+
WASMAudioDecoderCommon.modules.set(Ref, module);
|
|
108
|
+
}
|
|
109
|
+
return module;
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
concatFloat32: {
|
|
113
|
+
value(buffers, length2) {
|
|
114
|
+
let ret = new float32Array(length2), i = 0, offset = 0;
|
|
115
|
+
while (i < buffers.length) {
|
|
116
|
+
ret.set(buffers[i], offset);
|
|
117
|
+
offset += buffers[i++].length;
|
|
118
|
+
}
|
|
119
|
+
return ret;
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
getDecodedAudio: {
|
|
123
|
+
value: (errors, channelData, samplesDecoded, sampleRate2, bitDepth2) => ({
|
|
124
|
+
errors,
|
|
125
|
+
channelData,
|
|
126
|
+
samplesDecoded,
|
|
127
|
+
sampleRate: sampleRate2,
|
|
128
|
+
bitDepth: bitDepth2
|
|
129
|
+
})
|
|
130
|
+
},
|
|
131
|
+
getDecodedAudioMultiChannel: {
|
|
132
|
+
value(errors, input, channelsDecoded, samplesDecoded, sampleRate2, bitDepth2) {
|
|
133
|
+
let channelData = [], i, j;
|
|
134
|
+
for (i = 0; i < channelsDecoded; i++) {
|
|
135
|
+
const channel2 = [];
|
|
136
|
+
for (j = 0; j < input.length; ) channel2.push(input[j++][i] || []);
|
|
137
|
+
channelData.push(
|
|
138
|
+
WASMAudioDecoderCommon.concatFloat32(channel2, samplesDecoded)
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
return WASMAudioDecoderCommon.getDecodedAudio(
|
|
142
|
+
errors,
|
|
143
|
+
channelData,
|
|
144
|
+
samplesDecoded,
|
|
145
|
+
sampleRate2,
|
|
146
|
+
bitDepth2
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
/*
|
|
151
|
+
******************
|
|
152
|
+
* Compression Code
|
|
153
|
+
******************
|
|
154
|
+
*/
|
|
155
|
+
inflateDynEncodeString: {
|
|
156
|
+
value(source) {
|
|
157
|
+
source = e(source);
|
|
158
|
+
return new Promise((resolve) => {
|
|
159
|
+
const puffString = String.raw`dynEncode012804c7886d()((()>+*§§)§,§§§§)§+§§§)§+.-()(*)-+)(.7*§)i¸¸,3§(i¸¸,3/G+.¡*(,(,3+)2å:-),§H(P*DI*H(P*@I++hH)H*r,hH(H(P*<J,i)^*<H,H(P*4U((I-H(H*i0J,^*DH+H-H*I+H,I*4)33H(H*H)^*DH(H+H)^*@H+i§H)i§3æ*).§K(iHI/+§H,iHn,§H+i(H+i(rCJ0I,H*I-+hH,,hH(H-V)(i)J.H.W)(i)c)(H,i)I,H-i*I-4)33i(I.*hH(V)(H+n5(H(i*I-i(I,i)I.+hH,i*J+iHn,hi(I-i*I,+hH,H/H-c)(H,iFn,hi(I,+hH,H0n5-H*V)(J(,hH/H(i)J(H(V)(J(i)c)(H)H(i)H,c)(3H*i*I*H,i)I,4(3(-H(H,W)(H-I-H,i*I,4)3(3(3H,H-I1H+I,H.i)H1V)(J.i(v5(33H.-H(H,i(c)(H,i*I,4)333)-§i*I*+§H*iHn,hi73H,H(i)8(H+J+H)P*(H*V)(J-r,§H)P*,H.i)H+H,i)V)(-H*i*I*H+i)I+H-H.I.H,H-i)I,4)333Ã+)-§iø7i(^*(iü7I,*h+hH+iDn,h*hilI+i)I,+hH+,hH+iô7H,c)(i)H+i´8W)(H,I,H+i*I+4)-+hH(H)8*J-i(p5.*h*h*hH-i')u,hH(P*(J+,hH(P*0J,H(P*,n50H+H,H-b((3H(P*0i)I.4)3H-i¨*n5*H-iÅ*s,hi73H-i)J+V)&+I,H(H+V)æ,8(I.H(H*8*J-i(p51H-i)J+i¸7V)(H(H+iø7V)(8(J/H(P*0J+s,hi73H+H,H.J,I.H(P*(m5(H.H(P*,s5.+hH,m5*H(P*(J.H+H.H+H/U((b((H(H(P*0i)J+^*0H,i)I,4(3(3H(H.^*03H-i¨*o5)33i(73(3(3-H,H+i)c)(H,i*I,H+i)I+4)33i)I-3H-3!2)0§K(i2J,L(H,H(^*(H,H*^*4H,i(^*0H,i(^*DH,j(_*<H,H)P*(^*,H,H+P*(^*8*h*h+hH,i)8(I3i§I**h*h*h*h*h*h*hH,i*8(6+(),03H,j(_*@i*I-H,P*<J.i,J(H,P*8J/s50H,H.i+J0^*<i¦I*H.H,P*4J1J.U(*H.U((J2i')o5/H.U()I.H,H(^*<H0H1U((H.i0J.i§i0i')o5/H/H.H2J*H(J.q50H,P*0J/H*I-H,P*(J0,hH,P*,H-q,hi)I-423+hH*m5+H/H0H(H1U((b((H/i)I/H(i)I(H*i)I*4(3(3H,H.^*<H,H-^*04*3iØ1U((5+i(I(i¨7i1^*(i$6iè1^*(i°7iè6^*(i¬7iÈ6^*(+hH(iÈ*n,hiÈ*I(+hH(i¨,n,hi¨,I(+hH(iØ,n,hiØ,I(+hH(iè,o,hH,i-H(i0c)(H(i*I(4)33iè1i1H,i-iÈ*8)Bi(I(+hH(ido,hH,i-H(i-c)(H(i*I(4)33iÈ6iè6H,i-iF8)BiØ1i)b((41-H,i-H(i/c)(H(i*I(4)3(3(-H,i-H(i1c)(H(i*I(4)3(3(-H,i-H(i0c)(H(i*I(4)3(3(3H,H/^*0H,H(^*<3i(I*4*3H,H,i¸)^*TH,H,iø-^*PH,H,iX^*LH,H,i(^*HH,i-8(I(H,i-8(I-i¥I*H,i,8(I.H(iErH-iEr5)H(i©*I1H-i)I0i(i;H.i,J(i(H(i(rCJ(J*H*i;sCI*i¨1I-H(I/+hH/,hH,i-H-V)(i)H,i+8(c)(H/i)I/H-i*I-H*i)I*4)-H(i)i¨1I/+hH(H*o,hH,i-H/V)(i)i(c)(H/i*I/H(i)I(4)33i¤I*H,iø-H,i¸)H,i-i;8)5+H0H1I2i(I-+hH-H2p,hH,H,iP8*J*i(p5-H*i7u,hH,i-H-i)H*c)(H-i)I-4*3i(I/i+I.i+I(*h*h*hH*i86*(*)3H-m,hi£I*403H-i)H,W)-I/i*I(4)3i3I.i/I(3H2H,H(8(H.J(H-J.p,hi¢I*4.3H,i-H-i)I*+hH(,hH*H/c)(H*i*I*H(i)I(4)-H.I-4+3(3(33H,W)1m,hiI*4,3H,iø-H,i¸)H,i-H18)J(,hi¡I*H(i(p5,H1H,V)ú-H,V)ø-o5,3H,i(H,iXH,i-H1i)H08)J(,hi I*H(i(p5,H0H,V)H,V)o5,3H,H,iPH,iH8+I*4+3(3(3H,i$6i¬78+I*3H*H3m5(3i)I-H*i(r5)3H)H,P*0^*(H+H,P*<^*(H*I-3H,i2L(H-33Á)+(i¨03b+(,(-(.(/(0(1(2(3(5(7(9(;(?(C(G(K(S([(c(k({(((«(Ë(ë((*)(iø03O)()()()(*(*(*(*(+(+(+(+(,(,(,(,(-(-(-(-(i¨13M8(9(:(((0(/(1(.(2(-(3(,(4(+(5(*(6()(7(T7*S7US0U `;
|
|
160
|
+
WASMAudioDecoderCommon.getModule(WASMAudioDecoderCommon, puffString).then((wasm) => WebAssembly.instantiate(wasm, {})).then(({ exports }) => {
|
|
161
|
+
const instanceExports = new Map(Object.entries(exports));
|
|
162
|
+
const puff = instanceExports.get("puff");
|
|
163
|
+
const memory = instanceExports.get("memory")["buffer"];
|
|
164
|
+
const dataArray = new uint8Array2(memory);
|
|
165
|
+
const heapView = new DataView(memory);
|
|
166
|
+
let heapPos = instanceExports.get("__heap_base");
|
|
167
|
+
const sourceLength = source.length;
|
|
168
|
+
const sourceLengthPtr = heapPos;
|
|
169
|
+
heapPos += 4;
|
|
170
|
+
heapView.setInt32(sourceLengthPtr, sourceLength, true);
|
|
171
|
+
const sourcePtr = heapPos;
|
|
172
|
+
heapPos += sourceLength;
|
|
173
|
+
dataArray.set(source, sourcePtr);
|
|
174
|
+
const destLengthPtr = heapPos;
|
|
175
|
+
heapPos += 4;
|
|
176
|
+
heapView.setInt32(
|
|
177
|
+
destLengthPtr,
|
|
178
|
+
dataArray.byteLength - heapPos,
|
|
179
|
+
true
|
|
180
|
+
);
|
|
181
|
+
puff(heapPos, destLengthPtr, sourcePtr, sourceLengthPtr);
|
|
182
|
+
resolve(
|
|
183
|
+
dataArray.slice(
|
|
184
|
+
heapPos,
|
|
185
|
+
heapPos + heapView.getInt32(destLengthPtr, true)
|
|
186
|
+
)
|
|
187
|
+
);
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
Object.defineProperty(this, "wasm", {
|
|
195
|
+
enumerable: true,
|
|
196
|
+
get: () => this._wasm
|
|
197
|
+
});
|
|
198
|
+
this.getOutputChannels = (outputData, channelsDecoded, samplesDecoded) => {
|
|
199
|
+
let output = [], i = 0;
|
|
200
|
+
while (i < channelsDecoded)
|
|
201
|
+
output.push(
|
|
202
|
+
outputData.slice(
|
|
203
|
+
i * samplesDecoded,
|
|
204
|
+
i++ * samplesDecoded + samplesDecoded
|
|
205
|
+
)
|
|
206
|
+
);
|
|
207
|
+
return output;
|
|
208
|
+
};
|
|
209
|
+
this.allocateTypedArray = (len, TypedArray, setPointer = true) => {
|
|
210
|
+
const ptr = this._wasm.malloc(TypedArray.BYTES_PER_ELEMENT * len);
|
|
211
|
+
if (setPointer) this._pointers.add(ptr);
|
|
212
|
+
return {
|
|
213
|
+
ptr,
|
|
214
|
+
len,
|
|
215
|
+
buf: new TypedArray(this._wasm.HEAP, ptr, len)
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
this.free = () => {
|
|
219
|
+
this._pointers.forEach((ptr) => {
|
|
220
|
+
this._wasm.free(ptr);
|
|
221
|
+
});
|
|
222
|
+
this._pointers.clear();
|
|
223
|
+
};
|
|
224
|
+
this.codeToString = (ptr) => {
|
|
225
|
+
const characters = [], heap = new Uint8Array(this._wasm.HEAP);
|
|
226
|
+
for (let character = heap[ptr]; character !== 0; character = heap[++ptr])
|
|
227
|
+
characters.push(character);
|
|
228
|
+
return String.fromCharCode.apply(null, characters);
|
|
229
|
+
};
|
|
230
|
+
this.addError = (errors, message, frameLength2, frameNumber2, inputBytes, outputSamples) => {
|
|
231
|
+
errors.push({
|
|
232
|
+
message,
|
|
233
|
+
frameLength: frameLength2,
|
|
234
|
+
frameNumber: frameNumber2,
|
|
235
|
+
inputBytes,
|
|
236
|
+
outputSamples
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
this.instantiate = (_EmscriptenWASM, _module) => {
|
|
240
|
+
if (_module) WASMAudioDecoderCommon.setModule(_EmscriptenWASM, _module);
|
|
241
|
+
this._wasm = new _EmscriptenWASM(WASMAudioDecoderCommon).instantiate();
|
|
242
|
+
this._pointers = /* @__PURE__ */ new Set();
|
|
243
|
+
return this._wasm.ready.then(() => this);
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// ../../node_modules/codec-parser/index.js
|
|
248
|
+
init_text_decoder();
|
|
249
|
+
|
|
250
|
+
// ../../node_modules/codec-parser/src/CodecParser.js
|
|
251
|
+
init_text_decoder();
|
|
252
|
+
|
|
253
|
+
// ../../node_modules/codec-parser/src/utilities.js
|
|
254
|
+
init_text_decoder();
|
|
255
|
+
|
|
256
|
+
// ../../node_modules/codec-parser/src/constants.js
|
|
257
|
+
init_text_decoder();
|
|
258
|
+
var symbol = Symbol;
|
|
259
|
+
var mappingJoin = ", ";
|
|
260
|
+
var channelMappings = (() => {
|
|
261
|
+
const front = "front";
|
|
262
|
+
const side = "side";
|
|
263
|
+
const rear = "rear";
|
|
264
|
+
const left = "left";
|
|
265
|
+
const center = "center";
|
|
266
|
+
const right = "right";
|
|
267
|
+
return ["", front + " ", side + " ", rear + " "].map(
|
|
268
|
+
(x) => [
|
|
269
|
+
[left, right],
|
|
270
|
+
[left, right, center],
|
|
271
|
+
[left, center, right],
|
|
272
|
+
[center, left, right],
|
|
273
|
+
[center]
|
|
274
|
+
].flatMap((y) => y.map((z) => x + z).join(mappingJoin))
|
|
275
|
+
);
|
|
276
|
+
})();
|
|
277
|
+
var lfe = "LFE";
|
|
278
|
+
var monophonic = "monophonic (mono)";
|
|
279
|
+
var stereo = "stereo";
|
|
280
|
+
var surround = "surround";
|
|
281
|
+
var getChannelMapping = (channelCount, ...mappings) => `${[
|
|
282
|
+
monophonic,
|
|
283
|
+
stereo,
|
|
284
|
+
`linear ${surround}`,
|
|
285
|
+
"quadraphonic",
|
|
286
|
+
`5.0 ${surround}`,
|
|
287
|
+
`5.1 ${surround}`,
|
|
288
|
+
`6.1 ${surround}`,
|
|
289
|
+
`7.1 ${surround}`
|
|
290
|
+
][channelCount - 1]} (${mappings.join(mappingJoin)})`;
|
|
291
|
+
var vorbisOpusChannelMapping = [
|
|
292
|
+
monophonic,
|
|
293
|
+
getChannelMapping(2, channelMappings[0][0]),
|
|
294
|
+
getChannelMapping(3, channelMappings[0][2]),
|
|
295
|
+
getChannelMapping(4, channelMappings[1][0], channelMappings[3][0]),
|
|
296
|
+
getChannelMapping(5, channelMappings[1][2], channelMappings[3][0]),
|
|
297
|
+
getChannelMapping(6, channelMappings[1][2], channelMappings[3][0], lfe),
|
|
298
|
+
getChannelMapping(7, channelMappings[1][2], channelMappings[2][0], channelMappings[3][4], lfe),
|
|
299
|
+
getChannelMapping(8, channelMappings[1][2], channelMappings[2][0], channelMappings[3][0], lfe)
|
|
300
|
+
];
|
|
301
|
+
var rate192000 = 192e3;
|
|
302
|
+
var rate176400 = 176400;
|
|
303
|
+
var rate96000 = 96e3;
|
|
304
|
+
var rate88200 = 88200;
|
|
305
|
+
var rate64000 = 64e3;
|
|
306
|
+
var rate48000 = 48e3;
|
|
307
|
+
var rate44100 = 44100;
|
|
308
|
+
var rate32000 = 32e3;
|
|
309
|
+
var rate24000 = 24e3;
|
|
310
|
+
var rate22050 = 22050;
|
|
311
|
+
var rate16000 = 16e3;
|
|
312
|
+
var rate12000 = 12e3;
|
|
313
|
+
var rate11025 = 11025;
|
|
314
|
+
var rate8000 = 8e3;
|
|
315
|
+
var rate7350 = 7350;
|
|
316
|
+
var absoluteGranulePosition = "absoluteGranulePosition";
|
|
317
|
+
var bandwidth = "bandwidth";
|
|
318
|
+
var bitDepth = "bitDepth";
|
|
319
|
+
var bitrate = "bitrate";
|
|
320
|
+
var bitrateMaximum = bitrate + "Maximum";
|
|
321
|
+
var bitrateMinimum = bitrate + "Minimum";
|
|
322
|
+
var bitrateNominal = bitrate + "Nominal";
|
|
323
|
+
var buffer = "buffer";
|
|
324
|
+
var bufferFullness = buffer + "Fullness";
|
|
325
|
+
var codec = "codec";
|
|
326
|
+
var codecFrames = codec + "Frames";
|
|
327
|
+
var coupledStreamCount = "coupledStreamCount";
|
|
328
|
+
var crc = "crc";
|
|
329
|
+
var crc16 = crc + "16";
|
|
330
|
+
var crc32 = crc + "32";
|
|
331
|
+
var data = "data";
|
|
332
|
+
var description = "description";
|
|
333
|
+
var duration = "duration";
|
|
334
|
+
var emphasis = "emphasis";
|
|
335
|
+
var hasOpusPadding = "hasOpusPadding";
|
|
336
|
+
var header = "header";
|
|
337
|
+
var isContinuedPacket = "isContinuedPacket";
|
|
338
|
+
var isCopyrighted = "isCopyrighted";
|
|
339
|
+
var isFirstPage = "isFirstPage";
|
|
340
|
+
var isHome = "isHome";
|
|
341
|
+
var isLastPage = "isLastPage";
|
|
342
|
+
var isOriginal = "isOriginal";
|
|
343
|
+
var isPrivate = "isPrivate";
|
|
344
|
+
var isVbr = "isVbr";
|
|
345
|
+
var layer = "layer";
|
|
346
|
+
var length = "length";
|
|
347
|
+
var mode = "mode";
|
|
348
|
+
var modeExtension = mode + "Extension";
|
|
349
|
+
var mpeg = "mpeg";
|
|
350
|
+
var mpegVersion = mpeg + "Version";
|
|
351
|
+
var numberAACFrames = "numberAACFrames";
|
|
352
|
+
var outputGain = "outputGain";
|
|
353
|
+
var preSkip = "preSkip";
|
|
354
|
+
var profile = "profile";
|
|
355
|
+
var profileBits = symbol();
|
|
356
|
+
var protection = "protection";
|
|
357
|
+
var rawData = "rawData";
|
|
358
|
+
var segments = "segments";
|
|
359
|
+
var subarray = "subarray";
|
|
360
|
+
var version = "version";
|
|
361
|
+
var vorbis = "vorbis";
|
|
362
|
+
var vorbisComments = vorbis + "Comments";
|
|
363
|
+
var vorbisSetup = vorbis + "Setup";
|
|
364
|
+
var block = "block";
|
|
365
|
+
var blockingStrategy = block + "ingStrategy";
|
|
366
|
+
var blockingStrategyBits = symbol();
|
|
367
|
+
var blockSize = block + "Size";
|
|
368
|
+
var blocksize0 = block + "size0";
|
|
369
|
+
var blocksize1 = block + "size1";
|
|
370
|
+
var blockSizeBits = symbol();
|
|
371
|
+
var channel = "channel";
|
|
372
|
+
var channelMappingFamily = channel + "MappingFamily";
|
|
373
|
+
var channelMappingTable = channel + "MappingTable";
|
|
374
|
+
var channelMode = channel + "Mode";
|
|
375
|
+
var channelModeBits = symbol();
|
|
376
|
+
var channels = channel + "s";
|
|
377
|
+
var copyright = "copyright";
|
|
378
|
+
var copyrightId = copyright + "Id";
|
|
379
|
+
var copyrightIdStart = copyright + "IdStart";
|
|
380
|
+
var frame = "frame";
|
|
381
|
+
var frameCount = frame + "Count";
|
|
382
|
+
var frameLength = frame + "Length";
|
|
383
|
+
var Number2 = "Number";
|
|
384
|
+
var frameNumber = frame + Number2;
|
|
385
|
+
var framePadding = frame + "Padding";
|
|
386
|
+
var frameSize = frame + "Size";
|
|
387
|
+
var Rate = "Rate";
|
|
388
|
+
var inputSampleRate = "inputSample" + Rate;
|
|
389
|
+
var page = "page";
|
|
390
|
+
var pageChecksum = page + "Checksum";
|
|
391
|
+
var pageSegmentBytes = symbol();
|
|
392
|
+
var pageSegmentTable = page + "SegmentTable";
|
|
393
|
+
var pageSequenceNumber = page + "Sequence" + Number2;
|
|
394
|
+
var sample = "sample";
|
|
395
|
+
var sampleNumber = sample + Number2;
|
|
396
|
+
var sampleRate = sample + Rate;
|
|
397
|
+
var sampleRateBits = symbol();
|
|
398
|
+
var samples = sample + "s";
|
|
399
|
+
var stream = "stream";
|
|
400
|
+
var streamCount = stream + "Count";
|
|
401
|
+
var streamInfo = stream + "Info";
|
|
402
|
+
var streamSerialNumber = stream + "Serial" + Number2;
|
|
403
|
+
var streamStructureVersion = stream + "StructureVersion";
|
|
404
|
+
var total = "total";
|
|
405
|
+
var totalBytesOut = total + "BytesOut";
|
|
406
|
+
var totalDuration = total + "Duration";
|
|
407
|
+
var totalSamples = total + "Samples";
|
|
408
|
+
var readRawData = symbol();
|
|
409
|
+
var incrementRawData = symbol();
|
|
410
|
+
var mapCodecFrameStats = symbol();
|
|
411
|
+
var mapFrameStats = symbol();
|
|
412
|
+
var logWarning = symbol();
|
|
413
|
+
var logError2 = symbol();
|
|
414
|
+
var syncFrame = symbol();
|
|
415
|
+
var fixedLengthFrameSync = symbol();
|
|
416
|
+
var getHeader = symbol();
|
|
417
|
+
var setHeader = symbol();
|
|
418
|
+
var getFrame = symbol();
|
|
419
|
+
var parseFrame = symbol();
|
|
420
|
+
var parseOggPage = symbol();
|
|
421
|
+
var checkCodecUpdate = symbol();
|
|
422
|
+
var reset = symbol();
|
|
423
|
+
var enable = symbol();
|
|
424
|
+
var getHeaderFromUint8Array = symbol();
|
|
425
|
+
var checkFrameFooterCrc16 = symbol();
|
|
426
|
+
var uint8Array = Uint8Array;
|
|
427
|
+
var dataView = DataView;
|
|
428
|
+
var reserved = "reserved";
|
|
429
|
+
var bad = "bad";
|
|
430
|
+
var free = "free";
|
|
431
|
+
var none = "none";
|
|
432
|
+
var sixteenBitCRC = "16bit CRC";
|
|
433
|
+
|
|
434
|
+
// ../../node_modules/codec-parser/src/utilities.js
|
|
435
|
+
var getCrcTable = (crcTable, crcInitialValueFunction, crcFunction) => {
|
|
436
|
+
for (let byte = 0; byte < crcTable[length]; byte++) {
|
|
437
|
+
let crc2 = crcInitialValueFunction(byte);
|
|
438
|
+
for (let bit = 8; bit > 0; bit--) crc2 = crcFunction(crc2);
|
|
439
|
+
crcTable[byte] = crc2;
|
|
440
|
+
}
|
|
441
|
+
return crcTable;
|
|
442
|
+
};
|
|
443
|
+
var crc8Table = getCrcTable(
|
|
444
|
+
new uint8Array(256),
|
|
445
|
+
(b) => b,
|
|
446
|
+
(crc2) => crc2 & 128 ? 7 ^ crc2 << 1 : crc2 << 1
|
|
447
|
+
);
|
|
448
|
+
var flacCrc16Table = [
|
|
449
|
+
getCrcTable(
|
|
450
|
+
new Uint16Array(256),
|
|
451
|
+
(b) => b << 8,
|
|
452
|
+
(crc2) => crc2 << 1 ^ (crc2 & 1 << 15 ? 32773 : 0)
|
|
453
|
+
)
|
|
454
|
+
];
|
|
455
|
+
var crc32Table = [
|
|
456
|
+
getCrcTable(
|
|
457
|
+
new Uint32Array(256),
|
|
458
|
+
(b) => b,
|
|
459
|
+
(crc2) => crc2 >>> 1 ^ (crc2 & 1) * 3988292384
|
|
460
|
+
)
|
|
461
|
+
];
|
|
462
|
+
for (let i = 0; i < 15; i++) {
|
|
463
|
+
flacCrc16Table.push(new Uint16Array(256));
|
|
464
|
+
crc32Table.push(new Uint32Array(256));
|
|
465
|
+
for (let j = 0; j <= 255; j++) {
|
|
466
|
+
flacCrc16Table[i + 1][j] = flacCrc16Table[0][flacCrc16Table[i][j] >>> 8] ^ flacCrc16Table[i][j] << 8;
|
|
467
|
+
crc32Table[i + 1][j] = crc32Table[i][j] >>> 8 ^ crc32Table[0][crc32Table[i][j] & 255];
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
var crc8 = (data3) => {
|
|
471
|
+
let crc2 = 0;
|
|
472
|
+
const dataLength = data3[length];
|
|
473
|
+
for (let i = 0; i !== dataLength; i++) crc2 = crc8Table[crc2 ^ data3[i]];
|
|
474
|
+
return crc2;
|
|
475
|
+
};
|
|
476
|
+
var flacCrc16 = (data3) => {
|
|
477
|
+
const dataLength = data3[length];
|
|
478
|
+
const crcChunkSize = dataLength - 16;
|
|
479
|
+
let crc2 = 0;
|
|
480
|
+
let i = 0;
|
|
481
|
+
while (i <= crcChunkSize) {
|
|
482
|
+
crc2 ^= data3[i++] << 8 | data3[i++];
|
|
483
|
+
crc2 = flacCrc16Table[15][crc2 >> 8] ^ flacCrc16Table[14][crc2 & 255] ^ flacCrc16Table[13][data3[i++]] ^ flacCrc16Table[12][data3[i++]] ^ flacCrc16Table[11][data3[i++]] ^ flacCrc16Table[10][data3[i++]] ^ flacCrc16Table[9][data3[i++]] ^ flacCrc16Table[8][data3[i++]] ^ flacCrc16Table[7][data3[i++]] ^ flacCrc16Table[6][data3[i++]] ^ flacCrc16Table[5][data3[i++]] ^ flacCrc16Table[4][data3[i++]] ^ flacCrc16Table[3][data3[i++]] ^ flacCrc16Table[2][data3[i++]] ^ flacCrc16Table[1][data3[i++]] ^ flacCrc16Table[0][data3[i++]];
|
|
484
|
+
}
|
|
485
|
+
while (i !== dataLength)
|
|
486
|
+
crc2 = (crc2 & 255) << 8 ^ flacCrc16Table[0][crc2 >> 8 ^ data3[i++]];
|
|
487
|
+
return crc2;
|
|
488
|
+
};
|
|
489
|
+
var crc32Function = (data3) => {
|
|
490
|
+
const dataLength = data3[length];
|
|
491
|
+
const crcChunkSize = dataLength - 16;
|
|
492
|
+
let crc2 = 0;
|
|
493
|
+
let i = 0;
|
|
494
|
+
while (i <= crcChunkSize)
|
|
495
|
+
crc2 = crc32Table[15][(data3[i++] ^ crc2) & 255] ^ crc32Table[14][(data3[i++] ^ crc2 >>> 8) & 255] ^ crc32Table[13][(data3[i++] ^ crc2 >>> 16) & 255] ^ crc32Table[12][data3[i++] ^ crc2 >>> 24] ^ crc32Table[11][data3[i++]] ^ crc32Table[10][data3[i++]] ^ crc32Table[9][data3[i++]] ^ crc32Table[8][data3[i++]] ^ crc32Table[7][data3[i++]] ^ crc32Table[6][data3[i++]] ^ crc32Table[5][data3[i++]] ^ crc32Table[4][data3[i++]] ^ crc32Table[3][data3[i++]] ^ crc32Table[2][data3[i++]] ^ crc32Table[1][data3[i++]] ^ crc32Table[0][data3[i++]];
|
|
496
|
+
while (i !== dataLength)
|
|
497
|
+
crc2 = crc32Table[0][(crc2 ^ data3[i++]) & 255] ^ crc2 >>> 8;
|
|
498
|
+
return crc2 ^ -1;
|
|
499
|
+
};
|
|
500
|
+
var concatBuffers = (...buffers) => {
|
|
501
|
+
const buffer2 = new uint8Array(
|
|
502
|
+
buffers.reduce((acc, buf) => acc + buf[length], 0)
|
|
503
|
+
);
|
|
504
|
+
buffers.reduce((offset, buf) => {
|
|
505
|
+
buffer2.set(buf, offset);
|
|
506
|
+
return offset + buf[length];
|
|
507
|
+
}, 0);
|
|
508
|
+
return buffer2;
|
|
509
|
+
};
|
|
510
|
+
var bytesToString = (bytes) => String.fromCharCode(...bytes);
|
|
511
|
+
var reverseTable = [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15];
|
|
512
|
+
var reverse = (val) => reverseTable[val & 15] << 4 | reverseTable[val >> 4];
|
|
513
|
+
var BitReader = class {
|
|
514
|
+
constructor(data3) {
|
|
515
|
+
this._data = data3;
|
|
516
|
+
this._pos = data3[length] * 8;
|
|
517
|
+
}
|
|
518
|
+
set position(position) {
|
|
519
|
+
this._pos = position;
|
|
520
|
+
}
|
|
521
|
+
get position() {
|
|
522
|
+
return this._pos;
|
|
523
|
+
}
|
|
524
|
+
read(bits) {
|
|
525
|
+
const byte = Math.floor(this._pos / 8);
|
|
526
|
+
const bit = this._pos % 8;
|
|
527
|
+
this._pos -= bits;
|
|
528
|
+
const window = (reverse(this._data[byte - 1]) << 8) + reverse(this._data[byte]);
|
|
529
|
+
return window >> 7 - bit & 255;
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
var readInt64le = (view, offset) => {
|
|
533
|
+
try {
|
|
534
|
+
return view.getBigInt64(offset, true);
|
|
535
|
+
} catch {
|
|
536
|
+
const sign = view.getUint8(offset + 7) & 128 ? -1 : 1;
|
|
537
|
+
let firstPart = view.getUint32(offset, true);
|
|
538
|
+
let secondPart = view.getUint32(offset + 4, true);
|
|
539
|
+
if (sign === -1) {
|
|
540
|
+
firstPart = ~firstPart + 1;
|
|
541
|
+
secondPart = ~secondPart + 1;
|
|
542
|
+
}
|
|
543
|
+
if (secondPart > 1048575) {
|
|
544
|
+
console.warn("This platform does not support BigInt");
|
|
545
|
+
}
|
|
546
|
+
return sign * (firstPart + secondPart * 2 ** 32);
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
// ../../node_modules/codec-parser/src/codecs/HeaderCache.js
|
|
551
|
+
init_text_decoder();
|
|
552
|
+
var HeaderCache = class {
|
|
553
|
+
constructor(onCodecHeader, onCodecUpdate) {
|
|
554
|
+
this._onCodecHeader = onCodecHeader;
|
|
555
|
+
this._onCodecUpdate = onCodecUpdate;
|
|
556
|
+
this[reset]();
|
|
557
|
+
}
|
|
558
|
+
[enable]() {
|
|
559
|
+
this._isEnabled = true;
|
|
560
|
+
}
|
|
561
|
+
[reset]() {
|
|
562
|
+
this._headerCache = /* @__PURE__ */ new Map();
|
|
563
|
+
this._codecUpdateData = /* @__PURE__ */ new WeakMap();
|
|
564
|
+
this._codecHeaderSent = false;
|
|
565
|
+
this._codecShouldUpdate = false;
|
|
566
|
+
this._bitrate = null;
|
|
567
|
+
this._isEnabled = false;
|
|
568
|
+
}
|
|
569
|
+
[checkCodecUpdate](bitrate2, totalDuration2) {
|
|
570
|
+
if (this._onCodecUpdate) {
|
|
571
|
+
if (this._bitrate !== bitrate2) {
|
|
572
|
+
this._bitrate = bitrate2;
|
|
573
|
+
this._codecShouldUpdate = true;
|
|
574
|
+
}
|
|
575
|
+
const codecData = this._codecUpdateData.get(
|
|
576
|
+
this._headerCache.get(this._currentHeader)
|
|
577
|
+
);
|
|
578
|
+
if (this._codecShouldUpdate && codecData) {
|
|
579
|
+
this._onCodecUpdate(
|
|
580
|
+
{
|
|
581
|
+
bitrate: bitrate2,
|
|
582
|
+
...codecData
|
|
583
|
+
},
|
|
584
|
+
totalDuration2
|
|
585
|
+
);
|
|
586
|
+
}
|
|
587
|
+
this._codecShouldUpdate = false;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
[getHeader](key) {
|
|
591
|
+
const header2 = this._headerCache.get(key);
|
|
592
|
+
if (header2) {
|
|
593
|
+
this._updateCurrentHeader(key);
|
|
594
|
+
}
|
|
595
|
+
return header2;
|
|
596
|
+
}
|
|
597
|
+
[setHeader](key, header2, codecUpdateFields) {
|
|
598
|
+
if (this._isEnabled) {
|
|
599
|
+
if (!this._codecHeaderSent) {
|
|
600
|
+
this._onCodecHeader({ ...header2 });
|
|
601
|
+
this._codecHeaderSent = true;
|
|
602
|
+
}
|
|
603
|
+
this._updateCurrentHeader(key);
|
|
604
|
+
this._headerCache.set(key, header2);
|
|
605
|
+
this._codecUpdateData.set(header2, codecUpdateFields);
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
_updateCurrentHeader(key) {
|
|
609
|
+
if (this._onCodecUpdate && key !== this._currentHeader) {
|
|
610
|
+
this._codecShouldUpdate = true;
|
|
611
|
+
this._currentHeader = key;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
// ../../node_modules/codec-parser/src/codecs/mpeg/MPEGParser.js
|
|
617
|
+
init_text_decoder();
|
|
618
|
+
|
|
619
|
+
// ../../node_modules/codec-parser/src/codecs/Parser.js
|
|
620
|
+
init_text_decoder();
|
|
621
|
+
|
|
622
|
+
// ../../node_modules/codec-parser/src/globals.js
|
|
623
|
+
init_text_decoder();
|
|
624
|
+
var headerStore = /* @__PURE__ */ new WeakMap();
|
|
625
|
+
var frameStore = /* @__PURE__ */ new WeakMap();
|
|
626
|
+
|
|
627
|
+
// ../../node_modules/codec-parser/src/codecs/Parser.js
|
|
628
|
+
var Parser = class {
|
|
629
|
+
constructor(codecParser, headerCache) {
|
|
630
|
+
this._codecParser = codecParser;
|
|
631
|
+
this._headerCache = headerCache;
|
|
632
|
+
}
|
|
633
|
+
*[syncFrame]() {
|
|
634
|
+
let frameData;
|
|
635
|
+
do {
|
|
636
|
+
frameData = yield* this.Frame[getFrame](
|
|
637
|
+
this._codecParser,
|
|
638
|
+
this._headerCache,
|
|
639
|
+
0
|
|
640
|
+
);
|
|
641
|
+
if (frameData) return frameData;
|
|
642
|
+
this._codecParser[incrementRawData](1);
|
|
643
|
+
} while (true);
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* @description Searches for Frames within bytes containing a sequence of known codec frames.
|
|
647
|
+
* @param {boolean} ignoreNextFrame Set to true to return frames even if the next frame may not exist at the expected location
|
|
648
|
+
* @returns {Frame}
|
|
649
|
+
*/
|
|
650
|
+
*[fixedLengthFrameSync](ignoreNextFrame) {
|
|
651
|
+
let frameData = yield* this[syncFrame]();
|
|
652
|
+
const frameLength2 = frameStore.get(frameData)[length];
|
|
653
|
+
if (ignoreNextFrame || this._codecParser._flushing || // check if there is a frame right after this one
|
|
654
|
+
(yield* this.Header[getHeader](
|
|
655
|
+
this._codecParser,
|
|
656
|
+
this._headerCache,
|
|
657
|
+
frameLength2
|
|
658
|
+
))) {
|
|
659
|
+
this._headerCache[enable]();
|
|
660
|
+
this._codecParser[incrementRawData](frameLength2);
|
|
661
|
+
this._codecParser[mapFrameStats](frameData);
|
|
662
|
+
return frameData;
|
|
663
|
+
}
|
|
664
|
+
this._codecParser[logWarning](
|
|
665
|
+
`Missing ${frame} at ${frameLength2} bytes from current position.`,
|
|
666
|
+
`Dropping current ${frame} and trying again.`
|
|
667
|
+
);
|
|
668
|
+
this._headerCache[reset]();
|
|
669
|
+
this._codecParser[incrementRawData](1);
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
|
|
673
|
+
// ../../node_modules/codec-parser/src/codecs/mpeg/MPEGFrame.js
|
|
674
|
+
init_text_decoder();
|
|
675
|
+
|
|
676
|
+
// ../../node_modules/codec-parser/src/codecs/CodecFrame.js
|
|
677
|
+
init_text_decoder();
|
|
678
|
+
|
|
679
|
+
// ../../node_modules/codec-parser/src/containers/Frame.js
|
|
680
|
+
init_text_decoder();
|
|
681
|
+
var Frame = class {
|
|
682
|
+
constructor(headerValue, dataValue) {
|
|
683
|
+
frameStore.set(this, { [header]: headerValue });
|
|
684
|
+
this[data] = dataValue;
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
|
|
688
|
+
// ../../node_modules/codec-parser/src/codecs/CodecFrame.js
|
|
689
|
+
var CodecFrame = class extends Frame {
|
|
690
|
+
static *[getFrame](Header, Frame2, codecParser, headerCache, readOffset) {
|
|
691
|
+
const headerValue = yield* Header[getHeader](
|
|
692
|
+
codecParser,
|
|
693
|
+
headerCache,
|
|
694
|
+
readOffset
|
|
695
|
+
);
|
|
696
|
+
if (headerValue) {
|
|
697
|
+
const frameLengthValue = headerStore.get(headerValue)[frameLength];
|
|
698
|
+
const samplesValue = headerStore.get(headerValue)[samples];
|
|
699
|
+
const frame2 = (yield* codecParser[readRawData](
|
|
700
|
+
frameLengthValue,
|
|
701
|
+
readOffset
|
|
702
|
+
))[subarray](0, frameLengthValue);
|
|
703
|
+
return new Frame2(headerValue, frame2, samplesValue);
|
|
704
|
+
} else {
|
|
705
|
+
return null;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
constructor(headerValue, dataValue, samplesValue) {
|
|
709
|
+
super(headerValue, dataValue);
|
|
710
|
+
this[header] = headerValue;
|
|
711
|
+
this[samples] = samplesValue;
|
|
712
|
+
this[duration] = samplesValue / headerValue[sampleRate] * 1e3;
|
|
713
|
+
this[frameNumber] = null;
|
|
714
|
+
this[totalBytesOut] = null;
|
|
715
|
+
this[totalSamples] = null;
|
|
716
|
+
this[totalDuration] = null;
|
|
717
|
+
frameStore.get(this)[length] = dataValue[length];
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
// ../../node_modules/codec-parser/src/codecs/mpeg/MPEGHeader.js
|
|
722
|
+
init_text_decoder();
|
|
723
|
+
|
|
724
|
+
// ../../node_modules/codec-parser/src/metadata/ID3v2.js
|
|
725
|
+
init_text_decoder();
|
|
726
|
+
var unsynchronizationFlag = "unsynchronizationFlag";
|
|
727
|
+
var extendedHeaderFlag = "extendedHeaderFlag";
|
|
728
|
+
var experimentalFlag = "experimentalFlag";
|
|
729
|
+
var footerPresent = "footerPresent";
|
|
730
|
+
var ID3v2 = class _ID3v2 {
|
|
731
|
+
static *getID3v2Header(codecParser, headerCache, readOffset) {
|
|
732
|
+
const headerLength = 10;
|
|
733
|
+
const header2 = {};
|
|
734
|
+
let data3 = yield* codecParser[readRawData](3, readOffset);
|
|
735
|
+
if (data3[0] !== 73 || data3[1] !== 68 || data3[2] !== 51) return null;
|
|
736
|
+
data3 = yield* codecParser[readRawData](headerLength, readOffset);
|
|
737
|
+
header2[version] = `id3v2.${data3[3]}.${data3[4]}`;
|
|
738
|
+
if (data3[5] & 15) return null;
|
|
739
|
+
header2[unsynchronizationFlag] = !!(data3[5] & 128);
|
|
740
|
+
header2[extendedHeaderFlag] = !!(data3[5] & 64);
|
|
741
|
+
header2[experimentalFlag] = !!(data3[5] & 32);
|
|
742
|
+
header2[footerPresent] = !!(data3[5] & 16);
|
|
743
|
+
if (data3[6] & 128 || data3[7] & 128 || data3[8] & 128 || data3[9] & 128)
|
|
744
|
+
return null;
|
|
745
|
+
const dataLength = data3[6] << 21 | data3[7] << 14 | data3[8] << 7 | data3[9];
|
|
746
|
+
header2[length] = headerLength + dataLength;
|
|
747
|
+
return new _ID3v2(header2);
|
|
748
|
+
}
|
|
749
|
+
constructor(header2) {
|
|
750
|
+
this[version] = header2[version];
|
|
751
|
+
this[unsynchronizationFlag] = header2[unsynchronizationFlag];
|
|
752
|
+
this[extendedHeaderFlag] = header2[extendedHeaderFlag];
|
|
753
|
+
this[experimentalFlag] = header2[experimentalFlag];
|
|
754
|
+
this[footerPresent] = header2[footerPresent];
|
|
755
|
+
this[length] = header2[length];
|
|
756
|
+
}
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
// ../../node_modules/codec-parser/src/codecs/CodecHeader.js
|
|
760
|
+
init_text_decoder();
|
|
761
|
+
var CodecHeader = class {
|
|
762
|
+
/**
|
|
763
|
+
* @private
|
|
764
|
+
*/
|
|
765
|
+
constructor(header2) {
|
|
766
|
+
headerStore.set(this, header2);
|
|
767
|
+
this[bitDepth] = header2[bitDepth];
|
|
768
|
+
this[bitrate] = null;
|
|
769
|
+
this[channels] = header2[channels];
|
|
770
|
+
this[channelMode] = header2[channelMode];
|
|
771
|
+
this[sampleRate] = header2[sampleRate];
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
|
|
775
|
+
// ../../node_modules/codec-parser/src/codecs/mpeg/MPEGHeader.js
|
|
776
|
+
var bitrateMatrix = {
|
|
777
|
+
// bits | V1,L1 | V1,L2 | V1,L3 | V2,L1 | V2,L2 & L3
|
|
778
|
+
0: [free, free, free, free, free],
|
|
779
|
+
16: [32, 32, 32, 32, 8],
|
|
780
|
+
// 0b00100000: [64, 48, 40, 48, 16,],
|
|
781
|
+
// 0b00110000: [96, 56, 48, 56, 24,],
|
|
782
|
+
// 0b01000000: [128, 64, 56, 64, 32,],
|
|
783
|
+
// 0b01010000: [160, 80, 64, 80, 40,],
|
|
784
|
+
// 0b01100000: [192, 96, 80, 96, 48,],
|
|
785
|
+
// 0b01110000: [224, 112, 96, 112, 56,],
|
|
786
|
+
// 0b10000000: [256, 128, 112, 128, 64,],
|
|
787
|
+
// 0b10010000: [288, 160, 128, 144, 80,],
|
|
788
|
+
// 0b10100000: [320, 192, 160, 160, 96,],
|
|
789
|
+
// 0b10110000: [352, 224, 192, 176, 112,],
|
|
790
|
+
// 0b11000000: [384, 256, 224, 192, 128,],
|
|
791
|
+
// 0b11010000: [416, 320, 256, 224, 144,],
|
|
792
|
+
// 0b11100000: [448, 384, 320, 256, 160,],
|
|
793
|
+
240: [bad, bad, bad, bad, bad]
|
|
794
|
+
};
|
|
795
|
+
var calcBitrate = (idx, interval, intervalOffset) => 8 * ((idx + intervalOffset) % interval + interval) * (1 << (idx + intervalOffset) / interval) - 8 * interval * (interval / 8 | 0);
|
|
796
|
+
for (let i = 2; i < 15; i++)
|
|
797
|
+
bitrateMatrix[i << 4] = [
|
|
798
|
+
i * 32,
|
|
799
|
+
// V1,L1
|
|
800
|
+
calcBitrate(i, 4, 0),
|
|
801
|
+
// V1,L2
|
|
802
|
+
calcBitrate(i, 4, -1),
|
|
803
|
+
// V1,L3
|
|
804
|
+
calcBitrate(i, 8, 4),
|
|
805
|
+
// V2,L1
|
|
806
|
+
calcBitrate(i, 8, 0)
|
|
807
|
+
// V2,L2 & L3
|
|
808
|
+
];
|
|
809
|
+
var v1Layer1 = 0;
|
|
810
|
+
var v1Layer2 = 1;
|
|
811
|
+
var v1Layer3 = 2;
|
|
812
|
+
var v2Layer1 = 3;
|
|
813
|
+
var v2Layer23 = 4;
|
|
814
|
+
var bands = "bands ";
|
|
815
|
+
var to31 = " to 31";
|
|
816
|
+
var layer12ModeExtensions = {
|
|
817
|
+
0: bands + 4 + to31,
|
|
818
|
+
16: bands + 8 + to31,
|
|
819
|
+
32: bands + 12 + to31,
|
|
820
|
+
48: bands + 16 + to31
|
|
821
|
+
};
|
|
822
|
+
var bitrateIndex = "bitrateIndex";
|
|
823
|
+
var v2 = "v2";
|
|
824
|
+
var v1 = "v1";
|
|
825
|
+
var intensityStereo = "Intensity stereo ";
|
|
826
|
+
var msStereo = ", MS stereo ";
|
|
827
|
+
var on = "on";
|
|
828
|
+
var off = "off";
|
|
829
|
+
var layer3ModeExtensions = {
|
|
830
|
+
0: intensityStereo + off + msStereo + off,
|
|
831
|
+
16: intensityStereo + on + msStereo + off,
|
|
832
|
+
32: intensityStereo + off + msStereo + on,
|
|
833
|
+
48: intensityStereo + on + msStereo + on
|
|
834
|
+
};
|
|
835
|
+
var layersValues = {
|
|
836
|
+
0: { [description]: reserved },
|
|
837
|
+
2: {
|
|
838
|
+
[description]: "Layer III",
|
|
839
|
+
[framePadding]: 1,
|
|
840
|
+
[modeExtension]: layer3ModeExtensions,
|
|
841
|
+
[v1]: {
|
|
842
|
+
[bitrateIndex]: v1Layer3,
|
|
843
|
+
[samples]: 1152
|
|
844
|
+
},
|
|
845
|
+
[v2]: {
|
|
846
|
+
[bitrateIndex]: v2Layer23,
|
|
847
|
+
[samples]: 576
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
4: {
|
|
851
|
+
[description]: "Layer II",
|
|
852
|
+
[framePadding]: 1,
|
|
853
|
+
[modeExtension]: layer12ModeExtensions,
|
|
854
|
+
[samples]: 1152,
|
|
855
|
+
[v1]: {
|
|
856
|
+
[bitrateIndex]: v1Layer2
|
|
857
|
+
},
|
|
858
|
+
[v2]: {
|
|
859
|
+
[bitrateIndex]: v2Layer23
|
|
860
|
+
}
|
|
861
|
+
},
|
|
862
|
+
6: {
|
|
863
|
+
[description]: "Layer I",
|
|
864
|
+
[framePadding]: 4,
|
|
865
|
+
[modeExtension]: layer12ModeExtensions,
|
|
866
|
+
[samples]: 384,
|
|
867
|
+
[v1]: {
|
|
868
|
+
[bitrateIndex]: v1Layer1
|
|
869
|
+
},
|
|
870
|
+
[v2]: {
|
|
871
|
+
[bitrateIndex]: v2Layer1
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
var mpegVersionDescription = "MPEG Version ";
|
|
876
|
+
var isoIec = "ISO/IEC ";
|
|
877
|
+
var mpegVersions = {
|
|
878
|
+
0: {
|
|
879
|
+
[description]: `${mpegVersionDescription}2.5 (later extension of MPEG 2)`,
|
|
880
|
+
[layer]: v2,
|
|
881
|
+
[sampleRate]: {
|
|
882
|
+
0: rate11025,
|
|
883
|
+
4: rate12000,
|
|
884
|
+
8: rate8000,
|
|
885
|
+
12: reserved
|
|
886
|
+
}
|
|
887
|
+
},
|
|
888
|
+
8: { [description]: reserved },
|
|
889
|
+
16: {
|
|
890
|
+
[description]: `${mpegVersionDescription}2 (${isoIec}13818-3)`,
|
|
891
|
+
[layer]: v2,
|
|
892
|
+
[sampleRate]: {
|
|
893
|
+
0: rate22050,
|
|
894
|
+
4: rate24000,
|
|
895
|
+
8: rate16000,
|
|
896
|
+
12: reserved
|
|
897
|
+
}
|
|
898
|
+
},
|
|
899
|
+
24: {
|
|
900
|
+
[description]: `${mpegVersionDescription}1 (${isoIec}11172-3)`,
|
|
901
|
+
[layer]: v1,
|
|
902
|
+
[sampleRate]: {
|
|
903
|
+
0: rate44100,
|
|
904
|
+
4: rate48000,
|
|
905
|
+
8: rate32000,
|
|
906
|
+
12: reserved
|
|
907
|
+
}
|
|
908
|
+
},
|
|
909
|
+
length
|
|
910
|
+
};
|
|
911
|
+
var protectionValues = {
|
|
912
|
+
0: sixteenBitCRC,
|
|
913
|
+
1: none
|
|
914
|
+
};
|
|
915
|
+
var emphasisValues = {
|
|
916
|
+
0: none,
|
|
917
|
+
1: "50/15 ms",
|
|
918
|
+
2: reserved,
|
|
919
|
+
3: "CCIT J.17"
|
|
920
|
+
};
|
|
921
|
+
var channelModes = {
|
|
922
|
+
0: { [channels]: 2, [description]: stereo },
|
|
923
|
+
64: { [channels]: 2, [description]: "joint " + stereo },
|
|
924
|
+
128: { [channels]: 2, [description]: "dual channel" },
|
|
925
|
+
192: { [channels]: 1, [description]: monophonic }
|
|
926
|
+
};
|
|
927
|
+
var MPEGHeader = class _MPEGHeader extends CodecHeader {
|
|
928
|
+
static *[getHeader](codecParser, headerCache, readOffset) {
|
|
929
|
+
const header2 = {};
|
|
930
|
+
const id3v2Header = yield* ID3v2.getID3v2Header(
|
|
931
|
+
codecParser,
|
|
932
|
+
headerCache,
|
|
933
|
+
readOffset
|
|
934
|
+
);
|
|
935
|
+
if (id3v2Header) {
|
|
936
|
+
yield* codecParser[readRawData](id3v2Header[length], readOffset);
|
|
937
|
+
codecParser[incrementRawData](id3v2Header[length]);
|
|
938
|
+
}
|
|
939
|
+
const data3 = yield* codecParser[readRawData](4, readOffset);
|
|
940
|
+
const key = bytesToString(data3[subarray](0, 4));
|
|
941
|
+
const cachedHeader = headerCache[getHeader](key);
|
|
942
|
+
if (cachedHeader) return new _MPEGHeader(cachedHeader);
|
|
943
|
+
if (data3[0] !== 255 || data3[1] < 224) return null;
|
|
944
|
+
const mpegVersionValues2 = mpegVersions[data3[1] & 24];
|
|
945
|
+
if (mpegVersionValues2[description] === reserved) return null;
|
|
946
|
+
const layerBits = data3[1] & 6;
|
|
947
|
+
if (layersValues[layerBits][description] === reserved) return null;
|
|
948
|
+
const layerValues2 = {
|
|
949
|
+
...layersValues[layerBits],
|
|
950
|
+
...layersValues[layerBits][mpegVersionValues2[layer]]
|
|
951
|
+
};
|
|
952
|
+
header2[mpegVersion] = mpegVersionValues2[description];
|
|
953
|
+
header2[layer] = layerValues2[description];
|
|
954
|
+
header2[samples] = layerValues2[samples];
|
|
955
|
+
header2[protection] = protectionValues[data3[1] & 1];
|
|
956
|
+
header2[length] = 4;
|
|
957
|
+
header2[bitrate] = bitrateMatrix[data3[2] & 240][layerValues2[bitrateIndex]];
|
|
958
|
+
if (header2[bitrate] === bad) return null;
|
|
959
|
+
header2[sampleRate] = mpegVersionValues2[sampleRate][data3[2] & 12];
|
|
960
|
+
if (header2[sampleRate] === reserved) return null;
|
|
961
|
+
header2[framePadding] = data3[2] & 2 && layerValues2[framePadding];
|
|
962
|
+
header2[isPrivate] = !!(data3[2] & 1);
|
|
963
|
+
header2[frameLength] = Math.floor(
|
|
964
|
+
125 * header2[bitrate] * header2[samples] / header2[sampleRate] + header2[framePadding]
|
|
965
|
+
);
|
|
966
|
+
if (!header2[frameLength]) return null;
|
|
967
|
+
const channelModeBits2 = data3[3] & 192;
|
|
968
|
+
header2[channelMode] = channelModes[channelModeBits2][description];
|
|
969
|
+
header2[channels] = channelModes[channelModeBits2][channels];
|
|
970
|
+
header2[modeExtension] = layerValues2[modeExtension][data3[3] & 48];
|
|
971
|
+
header2[isCopyrighted] = !!(data3[3] & 8);
|
|
972
|
+
header2[isOriginal] = !!(data3[3] & 4);
|
|
973
|
+
header2[emphasis] = emphasisValues[data3[3] & 3];
|
|
974
|
+
if (header2[emphasis] === reserved) return null;
|
|
975
|
+
header2[bitDepth] = 16;
|
|
976
|
+
{
|
|
977
|
+
const { length: length2, frameLength: frameLength2, samples: samples3, ...codecUpdateFields } = header2;
|
|
978
|
+
headerCache[setHeader](key, header2, codecUpdateFields);
|
|
979
|
+
}
|
|
980
|
+
return new _MPEGHeader(header2);
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* @private
|
|
984
|
+
* Call MPEGHeader.getHeader(Array<Uint8>) to get instance
|
|
985
|
+
*/
|
|
986
|
+
constructor(header2) {
|
|
987
|
+
super(header2);
|
|
988
|
+
this[bitrate] = header2[bitrate];
|
|
989
|
+
this[emphasis] = header2[emphasis];
|
|
990
|
+
this[framePadding] = header2[framePadding];
|
|
991
|
+
this[isCopyrighted] = header2[isCopyrighted];
|
|
992
|
+
this[isOriginal] = header2[isOriginal];
|
|
993
|
+
this[isPrivate] = header2[isPrivate];
|
|
994
|
+
this[layer] = header2[layer];
|
|
995
|
+
this[modeExtension] = header2[modeExtension];
|
|
996
|
+
this[mpegVersion] = header2[mpegVersion];
|
|
997
|
+
this[protection] = header2[protection];
|
|
998
|
+
}
|
|
999
|
+
};
|
|
1000
|
+
|
|
1001
|
+
// ../../node_modules/codec-parser/src/codecs/mpeg/MPEGFrame.js
|
|
1002
|
+
var MPEGFrame = class _MPEGFrame extends CodecFrame {
|
|
1003
|
+
static *[getFrame](codecParser, headerCache, readOffset) {
|
|
1004
|
+
return yield* super[getFrame](
|
|
1005
|
+
MPEGHeader,
|
|
1006
|
+
_MPEGFrame,
|
|
1007
|
+
codecParser,
|
|
1008
|
+
headerCache,
|
|
1009
|
+
readOffset
|
|
1010
|
+
);
|
|
1011
|
+
}
|
|
1012
|
+
constructor(header2, frame2, samples3) {
|
|
1013
|
+
super(header2, frame2, samples3);
|
|
1014
|
+
}
|
|
1015
|
+
};
|
|
1016
|
+
|
|
1017
|
+
// ../../node_modules/codec-parser/src/codecs/mpeg/MPEGParser.js
|
|
1018
|
+
var MPEGParser = class extends Parser {
|
|
1019
|
+
constructor(codecParser, headerCache, onCodec) {
|
|
1020
|
+
super(codecParser, headerCache);
|
|
1021
|
+
this.Frame = MPEGFrame;
|
|
1022
|
+
this.Header = MPEGHeader;
|
|
1023
|
+
onCodec(this[codec]);
|
|
1024
|
+
}
|
|
1025
|
+
get [codec]() {
|
|
1026
|
+
return mpeg;
|
|
1027
|
+
}
|
|
1028
|
+
*[parseFrame]() {
|
|
1029
|
+
return yield* this[fixedLengthFrameSync]();
|
|
1030
|
+
}
|
|
1031
|
+
};
|
|
1032
|
+
|
|
1033
|
+
// ../../node_modules/codec-parser/src/codecs/aac/AACParser.js
|
|
1034
|
+
init_text_decoder();
|
|
1035
|
+
|
|
1036
|
+
// ../../node_modules/codec-parser/src/codecs/aac/AACFrame.js
|
|
1037
|
+
init_text_decoder();
|
|
1038
|
+
|
|
1039
|
+
// ../../node_modules/codec-parser/src/codecs/aac/AACHeader.js
|
|
1040
|
+
init_text_decoder();
|
|
1041
|
+
var mpegVersionValues = {
|
|
1042
|
+
0: "MPEG-4",
|
|
1043
|
+
8: "MPEG-2"
|
|
1044
|
+
};
|
|
1045
|
+
var layerValues = {
|
|
1046
|
+
0: "valid",
|
|
1047
|
+
2: bad,
|
|
1048
|
+
4: bad,
|
|
1049
|
+
6: bad
|
|
1050
|
+
};
|
|
1051
|
+
var protectionValues2 = {
|
|
1052
|
+
0: sixteenBitCRC,
|
|
1053
|
+
1: none
|
|
1054
|
+
};
|
|
1055
|
+
var profileValues = {
|
|
1056
|
+
0: "AAC Main",
|
|
1057
|
+
64: "AAC LC (Low Complexity)",
|
|
1058
|
+
128: "AAC SSR (Scalable Sample Rate)",
|
|
1059
|
+
192: "AAC LTP (Long Term Prediction)"
|
|
1060
|
+
};
|
|
1061
|
+
var sampleRates = {
|
|
1062
|
+
0: rate96000,
|
|
1063
|
+
4: rate88200,
|
|
1064
|
+
8: rate64000,
|
|
1065
|
+
12: rate48000,
|
|
1066
|
+
16: rate44100,
|
|
1067
|
+
20: rate32000,
|
|
1068
|
+
24: rate24000,
|
|
1069
|
+
28: rate22050,
|
|
1070
|
+
32: rate16000,
|
|
1071
|
+
36: rate12000,
|
|
1072
|
+
40: rate11025,
|
|
1073
|
+
44: rate8000,
|
|
1074
|
+
48: rate7350,
|
|
1075
|
+
52: reserved,
|
|
1076
|
+
56: reserved,
|
|
1077
|
+
60: "frequency is written explicitly"
|
|
1078
|
+
};
|
|
1079
|
+
var channelModeValues = {
|
|
1080
|
+
0: { [channels]: 0, [description]: "Defined in AOT Specific Config" },
|
|
1081
|
+
/*
|
|
1082
|
+
'monophonic (mono)'
|
|
1083
|
+
'stereo (left, right)'
|
|
1084
|
+
'linear surround (front center, front left, front right)'
|
|
1085
|
+
'quadraphonic (front center, front left, front right, rear center)'
|
|
1086
|
+
'5.0 surround (front center, front left, front right, rear left, rear right)'
|
|
1087
|
+
'5.1 surround (front center, front left, front right, rear left, rear right, LFE)'
|
|
1088
|
+
'7.1 surround (front center, front left, front right, side left, side right, rear left, rear right, LFE)'
|
|
1089
|
+
*/
|
|
1090
|
+
64: { [channels]: 1, [description]: monophonic },
|
|
1091
|
+
128: { [channels]: 2, [description]: getChannelMapping(2, channelMappings[0][0]) },
|
|
1092
|
+
192: { [channels]: 3, [description]: getChannelMapping(3, channelMappings[1][3]) },
|
|
1093
|
+
256: { [channels]: 4, [description]: getChannelMapping(4, channelMappings[1][3], channelMappings[3][4]) },
|
|
1094
|
+
320: { [channels]: 5, [description]: getChannelMapping(5, channelMappings[1][3], channelMappings[3][0]) },
|
|
1095
|
+
384: { [channels]: 6, [description]: getChannelMapping(6, channelMappings[1][3], channelMappings[3][0], lfe) },
|
|
1096
|
+
448: { [channels]: 8, [description]: getChannelMapping(8, channelMappings[1][3], channelMappings[2][0], channelMappings[3][0], lfe) }
|
|
1097
|
+
};
|
|
1098
|
+
var AACHeader = class _AACHeader extends CodecHeader {
|
|
1099
|
+
static *[getHeader](codecParser, headerCache, readOffset) {
|
|
1100
|
+
const header2 = {};
|
|
1101
|
+
const data3 = yield* codecParser[readRawData](7, readOffset);
|
|
1102
|
+
const key = bytesToString([
|
|
1103
|
+
data3[0],
|
|
1104
|
+
data3[1],
|
|
1105
|
+
data3[2],
|
|
1106
|
+
data3[3] & 252 | data3[6] & 3
|
|
1107
|
+
// frame length, buffer fullness varies so don't cache it
|
|
1108
|
+
]);
|
|
1109
|
+
const cachedHeader = headerCache[getHeader](key);
|
|
1110
|
+
if (!cachedHeader) {
|
|
1111
|
+
if (data3[0] !== 255 || data3[1] < 240) return null;
|
|
1112
|
+
header2[mpegVersion] = mpegVersionValues[data3[1] & 8];
|
|
1113
|
+
header2[layer] = layerValues[data3[1] & 6];
|
|
1114
|
+
if (header2[layer] === bad) return null;
|
|
1115
|
+
const protectionBit = data3[1] & 1;
|
|
1116
|
+
header2[protection] = protectionValues2[protectionBit];
|
|
1117
|
+
header2[length] = protectionBit ? 7 : 9;
|
|
1118
|
+
header2[profileBits] = data3[2] & 192;
|
|
1119
|
+
header2[sampleRateBits] = data3[2] & 60;
|
|
1120
|
+
const privateBit = data3[2] & 2;
|
|
1121
|
+
header2[profile] = profileValues[header2[profileBits]];
|
|
1122
|
+
header2[sampleRate] = sampleRates[header2[sampleRateBits]];
|
|
1123
|
+
if (header2[sampleRate] === reserved) return null;
|
|
1124
|
+
header2[isPrivate] = !!privateBit;
|
|
1125
|
+
header2[channelModeBits] = (data3[2] << 8 | data3[3]) & 448;
|
|
1126
|
+
header2[channelMode] = channelModeValues[header2[channelModeBits]][description];
|
|
1127
|
+
header2[channels] = channelModeValues[header2[channelModeBits]][channels];
|
|
1128
|
+
header2[isOriginal] = !!(data3[3] & 32);
|
|
1129
|
+
header2[isHome] = !!(data3[3] & 8);
|
|
1130
|
+
header2[copyrightId] = !!(data3[3] & 8);
|
|
1131
|
+
header2[copyrightIdStart] = !!(data3[3] & 4);
|
|
1132
|
+
header2[bitDepth] = 16;
|
|
1133
|
+
header2[samples] = 1024;
|
|
1134
|
+
header2[numberAACFrames] = data3[6] & 3;
|
|
1135
|
+
{
|
|
1136
|
+
const {
|
|
1137
|
+
length: length2,
|
|
1138
|
+
channelModeBits: channelModeBits2,
|
|
1139
|
+
profileBits: profileBits2,
|
|
1140
|
+
sampleRateBits: sampleRateBits2,
|
|
1141
|
+
frameLength: frameLength2,
|
|
1142
|
+
samples: samples3,
|
|
1143
|
+
numberAACFrames: numberAACFrames2,
|
|
1144
|
+
...codecUpdateFields
|
|
1145
|
+
} = header2;
|
|
1146
|
+
headerCache[setHeader](key, header2, codecUpdateFields);
|
|
1147
|
+
}
|
|
1148
|
+
} else {
|
|
1149
|
+
Object.assign(header2, cachedHeader);
|
|
1150
|
+
}
|
|
1151
|
+
header2[frameLength] = (data3[3] << 11 | data3[4] << 3 | data3[5] >> 5) & 8191;
|
|
1152
|
+
if (!header2[frameLength]) return null;
|
|
1153
|
+
const bufferFullnessBits = (data3[5] << 6 | data3[6] >> 2) & 2047;
|
|
1154
|
+
header2[bufferFullness] = bufferFullnessBits === 2047 ? "VBR" : bufferFullnessBits;
|
|
1155
|
+
return new _AACHeader(header2);
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
* @private
|
|
1159
|
+
* Call AACHeader.getHeader(Array<Uint8>) to get instance
|
|
1160
|
+
*/
|
|
1161
|
+
constructor(header2) {
|
|
1162
|
+
super(header2);
|
|
1163
|
+
this[copyrightId] = header2[copyrightId];
|
|
1164
|
+
this[copyrightIdStart] = header2[copyrightIdStart];
|
|
1165
|
+
this[bufferFullness] = header2[bufferFullness];
|
|
1166
|
+
this[isHome] = header2[isHome];
|
|
1167
|
+
this[isOriginal] = header2[isOriginal];
|
|
1168
|
+
this[isPrivate] = header2[isPrivate];
|
|
1169
|
+
this[layer] = header2[layer];
|
|
1170
|
+
this[length] = header2[length];
|
|
1171
|
+
this[mpegVersion] = header2[mpegVersion];
|
|
1172
|
+
this[numberAACFrames] = header2[numberAACFrames];
|
|
1173
|
+
this[profile] = header2[profile];
|
|
1174
|
+
this[protection] = header2[protection];
|
|
1175
|
+
}
|
|
1176
|
+
get audioSpecificConfig() {
|
|
1177
|
+
const header2 = headerStore.get(this);
|
|
1178
|
+
const audioSpecificConfig = header2[profileBits] + 64 << 5 | header2[sampleRateBits] << 5 | header2[channelModeBits] >> 3;
|
|
1179
|
+
const bytes = new uint8Array(2);
|
|
1180
|
+
new dataView(bytes[buffer]).setUint16(0, audioSpecificConfig, false);
|
|
1181
|
+
return bytes;
|
|
1182
|
+
}
|
|
1183
|
+
};
|
|
1184
|
+
|
|
1185
|
+
// ../../node_modules/codec-parser/src/codecs/aac/AACFrame.js
|
|
1186
|
+
var AACFrame = class _AACFrame extends CodecFrame {
|
|
1187
|
+
static *[getFrame](codecParser, headerCache, readOffset) {
|
|
1188
|
+
return yield* super[getFrame](
|
|
1189
|
+
AACHeader,
|
|
1190
|
+
_AACFrame,
|
|
1191
|
+
codecParser,
|
|
1192
|
+
headerCache,
|
|
1193
|
+
readOffset
|
|
1194
|
+
);
|
|
1195
|
+
}
|
|
1196
|
+
constructor(header2, frame2, samples3) {
|
|
1197
|
+
super(header2, frame2, samples3);
|
|
1198
|
+
}
|
|
1199
|
+
};
|
|
1200
|
+
|
|
1201
|
+
// ../../node_modules/codec-parser/src/codecs/aac/AACParser.js
|
|
1202
|
+
var AACParser = class extends Parser {
|
|
1203
|
+
constructor(codecParser, headerCache, onCodec) {
|
|
1204
|
+
super(codecParser, headerCache);
|
|
1205
|
+
this.Frame = AACFrame;
|
|
1206
|
+
this.Header = AACHeader;
|
|
1207
|
+
onCodec(this[codec]);
|
|
1208
|
+
}
|
|
1209
|
+
get [codec]() {
|
|
1210
|
+
return "aac";
|
|
1211
|
+
}
|
|
1212
|
+
*[parseFrame]() {
|
|
1213
|
+
return yield* this[fixedLengthFrameSync]();
|
|
1214
|
+
}
|
|
1215
|
+
};
|
|
1216
|
+
|
|
1217
|
+
// ../../node_modules/codec-parser/src/codecs/flac/FLACParser.js
|
|
1218
|
+
init_text_decoder();
|
|
1219
|
+
|
|
1220
|
+
// ../../node_modules/codec-parser/src/codecs/flac/FLACFrame.js
|
|
1221
|
+
init_text_decoder();
|
|
1222
|
+
var FLACFrame = class _FLACFrame extends CodecFrame {
|
|
1223
|
+
static _getFrameFooterCrc16(data3) {
|
|
1224
|
+
return (data3[data3[length] - 2] << 8) + data3[data3[length] - 1];
|
|
1225
|
+
}
|
|
1226
|
+
// check frame footer crc
|
|
1227
|
+
// https://xiph.org/flac/format.html#frame_footer
|
|
1228
|
+
static [checkFrameFooterCrc16](data3) {
|
|
1229
|
+
const expectedCrc16 = _FLACFrame._getFrameFooterCrc16(data3);
|
|
1230
|
+
const actualCrc16 = flacCrc16(data3[subarray](0, -2));
|
|
1231
|
+
return expectedCrc16 === actualCrc16;
|
|
1232
|
+
}
|
|
1233
|
+
constructor(data3, header2, streamInfoValue) {
|
|
1234
|
+
header2[streamInfo] = streamInfoValue;
|
|
1235
|
+
header2[crc16] = _FLACFrame._getFrameFooterCrc16(data3);
|
|
1236
|
+
super(header2, data3, headerStore.get(header2)[samples]);
|
|
1237
|
+
}
|
|
1238
|
+
};
|
|
1239
|
+
|
|
1240
|
+
// ../../node_modules/codec-parser/src/codecs/flac/FLACHeader.js
|
|
1241
|
+
init_text_decoder();
|
|
1242
|
+
var getFromStreamInfo = "get from STREAMINFO metadata block";
|
|
1243
|
+
var blockingStrategyValues = {
|
|
1244
|
+
0: "Fixed",
|
|
1245
|
+
1: "Variable"
|
|
1246
|
+
};
|
|
1247
|
+
var blockSizeValues = {
|
|
1248
|
+
0: reserved,
|
|
1249
|
+
16: 192
|
|
1250
|
+
// 0b00100000: 576,
|
|
1251
|
+
// 0b00110000: 1152,
|
|
1252
|
+
// 0b01000000: 2304,
|
|
1253
|
+
// 0b01010000: 4608,
|
|
1254
|
+
// 0b01100000: "8-bit (blocksize-1) from end of header",
|
|
1255
|
+
// 0b01110000: "16-bit (blocksize-1) from end of header",
|
|
1256
|
+
// 0b10000000: 256,
|
|
1257
|
+
// 0b10010000: 512,
|
|
1258
|
+
// 0b10100000: 1024,
|
|
1259
|
+
// 0b10110000: 2048,
|
|
1260
|
+
// 0b11000000: 4096,
|
|
1261
|
+
// 0b11010000: 8192,
|
|
1262
|
+
// 0b11100000: 16384,
|
|
1263
|
+
// 0b11110000: 32768,
|
|
1264
|
+
};
|
|
1265
|
+
for (let i = 2; i < 16; i++)
|
|
1266
|
+
blockSizeValues[i << 4] = i < 6 ? 576 * 2 ** (i - 2) : 2 ** i;
|
|
1267
|
+
var sampleRateValues = {
|
|
1268
|
+
0: getFromStreamInfo,
|
|
1269
|
+
1: rate88200,
|
|
1270
|
+
2: rate176400,
|
|
1271
|
+
3: rate192000,
|
|
1272
|
+
4: rate8000,
|
|
1273
|
+
5: rate16000,
|
|
1274
|
+
6: rate22050,
|
|
1275
|
+
7: rate24000,
|
|
1276
|
+
8: rate32000,
|
|
1277
|
+
9: rate44100,
|
|
1278
|
+
10: rate48000,
|
|
1279
|
+
11: rate96000,
|
|
1280
|
+
// 0b00001100: "8-bit sample rate (in kHz) from end of header",
|
|
1281
|
+
// 0b00001101: "16-bit sample rate (in Hz) from end of header",
|
|
1282
|
+
// 0b00001110: "16-bit sample rate (in tens of Hz) from end of header",
|
|
1283
|
+
15: bad
|
|
1284
|
+
};
|
|
1285
|
+
var channelAssignments = {
|
|
1286
|
+
/*'
|
|
1287
|
+
'monophonic (mono)'
|
|
1288
|
+
'stereo (left, right)'
|
|
1289
|
+
'linear surround (left, right, center)'
|
|
1290
|
+
'quadraphonic (front left, front right, rear left, rear right)'
|
|
1291
|
+
'5.0 surround (front left, front right, front center, rear left, rear right)'
|
|
1292
|
+
'5.1 surround (front left, front right, front center, LFE, rear left, rear right)'
|
|
1293
|
+
'6.1 surround (front left, front right, front center, LFE, rear center, side left, side right)'
|
|
1294
|
+
'7.1 surround (front left, front right, front center, LFE, rear left, rear right, side left, side right)'
|
|
1295
|
+
*/
|
|
1296
|
+
0: { [channels]: 1, [description]: monophonic },
|
|
1297
|
+
16: { [channels]: 2, [description]: getChannelMapping(2, channelMappings[0][0]) },
|
|
1298
|
+
32: { [channels]: 3, [description]: getChannelMapping(3, channelMappings[0][1]) },
|
|
1299
|
+
48: { [channels]: 4, [description]: getChannelMapping(4, channelMappings[1][0], channelMappings[3][0]) },
|
|
1300
|
+
64: { [channels]: 5, [description]: getChannelMapping(5, channelMappings[1][1], channelMappings[3][0]) },
|
|
1301
|
+
80: { [channels]: 6, [description]: getChannelMapping(6, channelMappings[1][1], lfe, channelMappings[3][0]) },
|
|
1302
|
+
96: { [channels]: 7, [description]: getChannelMapping(7, channelMappings[1][1], lfe, channelMappings[3][4], channelMappings[2][0]) },
|
|
1303
|
+
112: { [channels]: 8, [description]: getChannelMapping(8, channelMappings[1][1], lfe, channelMappings[3][0], channelMappings[2][0]) },
|
|
1304
|
+
128: { [channels]: 2, [description]: `${stereo} (left, diff)` },
|
|
1305
|
+
144: { [channels]: 2, [description]: `${stereo} (diff, right)` },
|
|
1306
|
+
160: { [channels]: 2, [description]: `${stereo} (avg, diff)` },
|
|
1307
|
+
176: reserved,
|
|
1308
|
+
192: reserved,
|
|
1309
|
+
208: reserved,
|
|
1310
|
+
224: reserved,
|
|
1311
|
+
240: reserved
|
|
1312
|
+
};
|
|
1313
|
+
var bitDepthValues = {
|
|
1314
|
+
0: getFromStreamInfo,
|
|
1315
|
+
2: 8,
|
|
1316
|
+
4: 12,
|
|
1317
|
+
6: reserved,
|
|
1318
|
+
8: 16,
|
|
1319
|
+
10: 20,
|
|
1320
|
+
12: 24,
|
|
1321
|
+
14: reserved
|
|
1322
|
+
};
|
|
1323
|
+
var FLACHeader = class _FLACHeader extends CodecHeader {
|
|
1324
|
+
// https://datatracker.ietf.org/doc/html/rfc3629#section-3
|
|
1325
|
+
// Char. number range | UTF-8 octet sequence
|
|
1326
|
+
// (hexadecimal) | (binary)
|
|
1327
|
+
// --------------------+---------------------------------------------
|
|
1328
|
+
// 0000 0000-0000 007F | 0xxxxxxx
|
|
1329
|
+
// 0000 0080-0000 07FF | 110xxxxx 10xxxxxx
|
|
1330
|
+
// 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
|
|
1331
|
+
// 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
|
|
1332
|
+
static _decodeUTF8Int(data3) {
|
|
1333
|
+
if (data3[0] > 254) {
|
|
1334
|
+
return null;
|
|
1335
|
+
}
|
|
1336
|
+
if (data3[0] < 128) return { value: data3[0], length: 1 };
|
|
1337
|
+
let length2 = 1;
|
|
1338
|
+
for (let zeroMask = 64; zeroMask & data3[0]; zeroMask >>= 1) length2++;
|
|
1339
|
+
let idx = length2 - 1, value = 0, shift = 0;
|
|
1340
|
+
for (; idx > 0; shift += 6, idx--) {
|
|
1341
|
+
if ((data3[idx] & 192) !== 128) {
|
|
1342
|
+
return null;
|
|
1343
|
+
}
|
|
1344
|
+
value |= (data3[idx] & 63) << shift;
|
|
1345
|
+
}
|
|
1346
|
+
value |= (data3[idx] & 127 >> length2) << shift;
|
|
1347
|
+
return { value, length: length2 };
|
|
1348
|
+
}
|
|
1349
|
+
static [getHeaderFromUint8Array](data3, headerCache) {
|
|
1350
|
+
const codecParserStub = {
|
|
1351
|
+
[readRawData]: function* () {
|
|
1352
|
+
return data3;
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
return _FLACHeader[getHeader](codecParserStub, headerCache, 0).next().value;
|
|
1356
|
+
}
|
|
1357
|
+
static *[getHeader](codecParser, headerCache, readOffset) {
|
|
1358
|
+
let data3 = yield* codecParser[readRawData](6, readOffset);
|
|
1359
|
+
if (data3[0] !== 255 || !(data3[1] === 248 || data3[1] === 249)) {
|
|
1360
|
+
return null;
|
|
1361
|
+
}
|
|
1362
|
+
const header2 = {};
|
|
1363
|
+
const key = bytesToString(data3[subarray](0, 4));
|
|
1364
|
+
const cachedHeader = headerCache[getHeader](key);
|
|
1365
|
+
if (!cachedHeader) {
|
|
1366
|
+
header2[blockingStrategyBits] = data3[1] & 1;
|
|
1367
|
+
header2[blockingStrategy] = blockingStrategyValues[header2[blockingStrategyBits]];
|
|
1368
|
+
header2[blockSizeBits] = data3[2] & 240;
|
|
1369
|
+
header2[sampleRateBits] = data3[2] & 15;
|
|
1370
|
+
header2[blockSize] = blockSizeValues[header2[blockSizeBits]];
|
|
1371
|
+
if (header2[blockSize] === reserved) {
|
|
1372
|
+
return null;
|
|
1373
|
+
}
|
|
1374
|
+
header2[sampleRate] = sampleRateValues[header2[sampleRateBits]];
|
|
1375
|
+
if (header2[sampleRate] === bad) {
|
|
1376
|
+
return null;
|
|
1377
|
+
}
|
|
1378
|
+
if (data3[3] & 1) {
|
|
1379
|
+
return null;
|
|
1380
|
+
}
|
|
1381
|
+
const channelAssignment = channelAssignments[data3[3] & 240];
|
|
1382
|
+
if (channelAssignment === reserved) {
|
|
1383
|
+
return null;
|
|
1384
|
+
}
|
|
1385
|
+
header2[channels] = channelAssignment[channels];
|
|
1386
|
+
header2[channelMode] = channelAssignment[description];
|
|
1387
|
+
header2[bitDepth] = bitDepthValues[data3[3] & 14];
|
|
1388
|
+
if (header2[bitDepth] === reserved) {
|
|
1389
|
+
return null;
|
|
1390
|
+
}
|
|
1391
|
+
} else {
|
|
1392
|
+
Object.assign(header2, cachedHeader);
|
|
1393
|
+
}
|
|
1394
|
+
header2[length] = 5;
|
|
1395
|
+
data3 = yield* codecParser[readRawData](header2[length] + 8, readOffset);
|
|
1396
|
+
const decodedUtf8 = _FLACHeader._decodeUTF8Int(data3[subarray](4));
|
|
1397
|
+
if (!decodedUtf8) {
|
|
1398
|
+
return null;
|
|
1399
|
+
}
|
|
1400
|
+
if (header2[blockingStrategyBits]) {
|
|
1401
|
+
header2[sampleNumber] = decodedUtf8.value;
|
|
1402
|
+
} else {
|
|
1403
|
+
header2[frameNumber] = decodedUtf8.value;
|
|
1404
|
+
}
|
|
1405
|
+
header2[length] += decodedUtf8[length];
|
|
1406
|
+
if (header2[blockSizeBits] === 96) {
|
|
1407
|
+
if (data3[length] < header2[length])
|
|
1408
|
+
data3 = yield* codecParser[readRawData](header2[length], readOffset);
|
|
1409
|
+
header2[blockSize] = data3[header2[length] - 1] + 1;
|
|
1410
|
+
header2[length] += 1;
|
|
1411
|
+
} else if (header2[blockSizeBits] === 112) {
|
|
1412
|
+
if (data3[length] < header2[length])
|
|
1413
|
+
data3 = yield* codecParser[readRawData](header2[length], readOffset);
|
|
1414
|
+
header2[blockSize] = (data3[header2[length] - 1] << 8) + data3[header2[length]] + 1;
|
|
1415
|
+
header2[length] += 2;
|
|
1416
|
+
}
|
|
1417
|
+
header2[samples] = header2[blockSize];
|
|
1418
|
+
if (header2[sampleRateBits] === 12) {
|
|
1419
|
+
if (data3[length] < header2[length])
|
|
1420
|
+
data3 = yield* codecParser[readRawData](header2[length], readOffset);
|
|
1421
|
+
header2[sampleRate] = data3[header2[length] - 1] * 1e3;
|
|
1422
|
+
header2[length] += 1;
|
|
1423
|
+
} else if (header2[sampleRateBits] === 13) {
|
|
1424
|
+
if (data3[length] < header2[length])
|
|
1425
|
+
data3 = yield* codecParser[readRawData](header2[length], readOffset);
|
|
1426
|
+
header2[sampleRate] = (data3[header2[length] - 1] << 8) + data3[header2[length]];
|
|
1427
|
+
header2[length] += 2;
|
|
1428
|
+
} else if (header2[sampleRateBits] === 14) {
|
|
1429
|
+
if (data3[length] < header2[length])
|
|
1430
|
+
data3 = yield* codecParser[readRawData](header2[length], readOffset);
|
|
1431
|
+
header2[sampleRate] = ((data3[header2[length] - 1] << 8) + data3[header2[length]]) * 10;
|
|
1432
|
+
header2[length] += 2;
|
|
1433
|
+
}
|
|
1434
|
+
if (data3[length] < header2[length])
|
|
1435
|
+
data3 = yield* codecParser[readRawData](header2[length], readOffset);
|
|
1436
|
+
header2[crc] = data3[header2[length] - 1];
|
|
1437
|
+
if (header2[crc] !== crc8(data3[subarray](0, header2[length] - 1))) {
|
|
1438
|
+
return null;
|
|
1439
|
+
}
|
|
1440
|
+
{
|
|
1441
|
+
if (!cachedHeader) {
|
|
1442
|
+
const {
|
|
1443
|
+
blockingStrategyBits: blockingStrategyBits2,
|
|
1444
|
+
frameNumber: frameNumber2,
|
|
1445
|
+
sampleNumber: sampleNumber2,
|
|
1446
|
+
samples: samples3,
|
|
1447
|
+
sampleRateBits: sampleRateBits2,
|
|
1448
|
+
blockSizeBits: blockSizeBits2,
|
|
1449
|
+
crc: crc2,
|
|
1450
|
+
length: length2,
|
|
1451
|
+
...codecUpdateFields
|
|
1452
|
+
} = header2;
|
|
1453
|
+
headerCache[setHeader](key, header2, codecUpdateFields);
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
return new _FLACHeader(header2);
|
|
1457
|
+
}
|
|
1458
|
+
/**
|
|
1459
|
+
* @private
|
|
1460
|
+
* Call FLACHeader.getHeader(Array<Uint8>) to get instance
|
|
1461
|
+
*/
|
|
1462
|
+
constructor(header2) {
|
|
1463
|
+
super(header2);
|
|
1464
|
+
this[crc16] = null;
|
|
1465
|
+
this[blockingStrategy] = header2[blockingStrategy];
|
|
1466
|
+
this[blockSize] = header2[blockSize];
|
|
1467
|
+
this[frameNumber] = header2[frameNumber];
|
|
1468
|
+
this[sampleNumber] = header2[sampleNumber];
|
|
1469
|
+
this[streamInfo] = null;
|
|
1470
|
+
}
|
|
1471
|
+
};
|
|
1472
|
+
|
|
1473
|
+
// ../../node_modules/codec-parser/src/codecs/flac/FLACParser.js
|
|
1474
|
+
var MIN_FLAC_FRAME_SIZE = 2;
|
|
1475
|
+
var MAX_FLAC_FRAME_SIZE = 512 * 1024;
|
|
1476
|
+
var FLACParser = class extends Parser {
|
|
1477
|
+
constructor(codecParser, headerCache, onCodec) {
|
|
1478
|
+
super(codecParser, headerCache);
|
|
1479
|
+
this.Frame = FLACFrame;
|
|
1480
|
+
this.Header = FLACHeader;
|
|
1481
|
+
onCodec(this[codec]);
|
|
1482
|
+
}
|
|
1483
|
+
get [codec]() {
|
|
1484
|
+
return "flac";
|
|
1485
|
+
}
|
|
1486
|
+
*_getNextFrameSyncOffset(offset) {
|
|
1487
|
+
const data3 = yield* this._codecParser[readRawData](2, 0);
|
|
1488
|
+
const dataLength = data3[length] - 2;
|
|
1489
|
+
while (offset < dataLength) {
|
|
1490
|
+
const firstByte = data3[offset];
|
|
1491
|
+
if (firstByte === 255) {
|
|
1492
|
+
const secondByte = data3[offset + 1];
|
|
1493
|
+
if (secondByte === 248 || secondByte === 249) break;
|
|
1494
|
+
if (secondByte !== 255) offset++;
|
|
1495
|
+
}
|
|
1496
|
+
offset++;
|
|
1497
|
+
}
|
|
1498
|
+
return offset;
|
|
1499
|
+
}
|
|
1500
|
+
*[parseFrame]() {
|
|
1501
|
+
do {
|
|
1502
|
+
const header2 = yield* FLACHeader[getHeader](
|
|
1503
|
+
this._codecParser,
|
|
1504
|
+
this._headerCache,
|
|
1505
|
+
0
|
|
1506
|
+
);
|
|
1507
|
+
if (header2) {
|
|
1508
|
+
let nextHeaderOffset = headerStore.get(header2)[length] + MIN_FLAC_FRAME_SIZE;
|
|
1509
|
+
while (nextHeaderOffset <= MAX_FLAC_FRAME_SIZE) {
|
|
1510
|
+
if (this._codecParser._flushing || (yield* FLACHeader[getHeader](
|
|
1511
|
+
this._codecParser,
|
|
1512
|
+
this._headerCache,
|
|
1513
|
+
nextHeaderOffset
|
|
1514
|
+
))) {
|
|
1515
|
+
let frameData = yield* this._codecParser[readRawData](nextHeaderOffset);
|
|
1516
|
+
if (!this._codecParser._flushing)
|
|
1517
|
+
frameData = frameData[subarray](0, nextHeaderOffset);
|
|
1518
|
+
if (FLACFrame[checkFrameFooterCrc16](frameData)) {
|
|
1519
|
+
const frame2 = new FLACFrame(frameData, header2);
|
|
1520
|
+
this._headerCache[enable]();
|
|
1521
|
+
this._codecParser[incrementRawData](nextHeaderOffset);
|
|
1522
|
+
this._codecParser[mapFrameStats](frame2);
|
|
1523
|
+
return frame2;
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
nextHeaderOffset = yield* this._getNextFrameSyncOffset(
|
|
1527
|
+
nextHeaderOffset + 1
|
|
1528
|
+
);
|
|
1529
|
+
}
|
|
1530
|
+
this._codecParser[logWarning](
|
|
1531
|
+
`Unable to sync FLAC frame after searching ${nextHeaderOffset} bytes.`
|
|
1532
|
+
);
|
|
1533
|
+
this._codecParser[incrementRawData](nextHeaderOffset);
|
|
1534
|
+
} else {
|
|
1535
|
+
this._codecParser[incrementRawData](
|
|
1536
|
+
yield* this._getNextFrameSyncOffset(1)
|
|
1537
|
+
);
|
|
1538
|
+
}
|
|
1539
|
+
} while (true);
|
|
1540
|
+
}
|
|
1541
|
+
[parseOggPage](oggPage) {
|
|
1542
|
+
if (oggPage[pageSequenceNumber] === 0) {
|
|
1543
|
+
this._headerCache[enable]();
|
|
1544
|
+
this._streamInfo = oggPage[data][subarray](13);
|
|
1545
|
+
} else if (oggPage[pageSequenceNumber] === 1) {
|
|
1546
|
+
} else {
|
|
1547
|
+
oggPage[codecFrames] = frameStore.get(oggPage)[segments].map((segment) => {
|
|
1548
|
+
const header2 = FLACHeader[getHeaderFromUint8Array](
|
|
1549
|
+
segment,
|
|
1550
|
+
this._headerCache
|
|
1551
|
+
);
|
|
1552
|
+
if (header2) {
|
|
1553
|
+
return new FLACFrame(segment, header2, this._streamInfo);
|
|
1554
|
+
} else {
|
|
1555
|
+
this._codecParser[logWarning](
|
|
1556
|
+
"Failed to parse Ogg FLAC frame",
|
|
1557
|
+
"Skipping invalid FLAC frame"
|
|
1558
|
+
);
|
|
1559
|
+
}
|
|
1560
|
+
}).filter((frame2) => !!frame2);
|
|
1561
|
+
}
|
|
1562
|
+
return oggPage;
|
|
1563
|
+
}
|
|
1564
|
+
};
|
|
1565
|
+
|
|
1566
|
+
// ../../node_modules/codec-parser/src/containers/ogg/OggParser.js
|
|
1567
|
+
init_text_decoder();
|
|
1568
|
+
|
|
1569
|
+
// ../../node_modules/codec-parser/src/containers/ogg/OggPage.js
|
|
1570
|
+
init_text_decoder();
|
|
1571
|
+
|
|
1572
|
+
// ../../node_modules/codec-parser/src/containers/ogg/OggPageHeader.js
|
|
1573
|
+
init_text_decoder();
|
|
1574
|
+
var OggPageHeader = class _OggPageHeader {
|
|
1575
|
+
static *[getHeader](codecParser, headerCache, readOffset) {
|
|
1576
|
+
const header2 = {};
|
|
1577
|
+
let data3 = yield* codecParser[readRawData](28, readOffset);
|
|
1578
|
+
if (data3[0] !== 79 || // O
|
|
1579
|
+
data3[1] !== 103 || // g
|
|
1580
|
+
data3[2] !== 103 || // g
|
|
1581
|
+
data3[3] !== 83) {
|
|
1582
|
+
return null;
|
|
1583
|
+
}
|
|
1584
|
+
header2[streamStructureVersion] = data3[4];
|
|
1585
|
+
const zeros = data3[5] & 248;
|
|
1586
|
+
if (zeros) return null;
|
|
1587
|
+
header2[isLastPage] = !!(data3[5] & 4);
|
|
1588
|
+
header2[isFirstPage] = !!(data3[5] & 2);
|
|
1589
|
+
header2[isContinuedPacket] = !!(data3[5] & 1);
|
|
1590
|
+
const view = new dataView(uint8Array.from(data3[subarray](0, 28))[buffer]);
|
|
1591
|
+
header2[absoluteGranulePosition] = readInt64le(view, 6);
|
|
1592
|
+
header2[streamSerialNumber] = view.getInt32(14, true);
|
|
1593
|
+
header2[pageSequenceNumber] = view.getInt32(18, true);
|
|
1594
|
+
header2[pageChecksum] = view.getInt32(22, true);
|
|
1595
|
+
const pageSegmentTableLength = data3[26];
|
|
1596
|
+
header2[length] = pageSegmentTableLength + 27;
|
|
1597
|
+
data3 = yield* codecParser[readRawData](header2[length], readOffset);
|
|
1598
|
+
header2[frameLength] = 0;
|
|
1599
|
+
header2[pageSegmentTable] = [];
|
|
1600
|
+
header2[pageSegmentBytes] = uint8Array.from(
|
|
1601
|
+
data3[subarray](27, header2[length])
|
|
1602
|
+
);
|
|
1603
|
+
for (let i = 0, segmentLength = 0; i < pageSegmentTableLength; i++) {
|
|
1604
|
+
const segmentByte = header2[pageSegmentBytes][i];
|
|
1605
|
+
header2[frameLength] += segmentByte;
|
|
1606
|
+
segmentLength += segmentByte;
|
|
1607
|
+
if (segmentByte !== 255 || i === pageSegmentTableLength - 1) {
|
|
1608
|
+
header2[pageSegmentTable].push(segmentLength);
|
|
1609
|
+
segmentLength = 0;
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
return new _OggPageHeader(header2);
|
|
1613
|
+
}
|
|
1614
|
+
/**
|
|
1615
|
+
* @private
|
|
1616
|
+
* Call OggPageHeader.getHeader(Array<Uint8>) to get instance
|
|
1617
|
+
*/
|
|
1618
|
+
constructor(header2) {
|
|
1619
|
+
headerStore.set(this, header2);
|
|
1620
|
+
this[absoluteGranulePosition] = header2[absoluteGranulePosition];
|
|
1621
|
+
this[isContinuedPacket] = header2[isContinuedPacket];
|
|
1622
|
+
this[isFirstPage] = header2[isFirstPage];
|
|
1623
|
+
this[isLastPage] = header2[isLastPage];
|
|
1624
|
+
this[pageSegmentTable] = header2[pageSegmentTable];
|
|
1625
|
+
this[pageSequenceNumber] = header2[pageSequenceNumber];
|
|
1626
|
+
this[pageChecksum] = header2[pageChecksum];
|
|
1627
|
+
this[streamSerialNumber] = header2[streamSerialNumber];
|
|
1628
|
+
}
|
|
1629
|
+
};
|
|
1630
|
+
|
|
1631
|
+
// ../../node_modules/codec-parser/src/containers/ogg/OggPage.js
|
|
1632
|
+
var OggPage = class _OggPage extends Frame {
|
|
1633
|
+
static *[getFrame](codecParser, headerCache, readOffset) {
|
|
1634
|
+
const header2 = yield* OggPageHeader[getHeader](
|
|
1635
|
+
codecParser,
|
|
1636
|
+
headerCache,
|
|
1637
|
+
readOffset
|
|
1638
|
+
);
|
|
1639
|
+
if (header2) {
|
|
1640
|
+
const frameLengthValue = headerStore.get(header2)[frameLength];
|
|
1641
|
+
const headerLength = headerStore.get(header2)[length];
|
|
1642
|
+
const totalLength = headerLength + frameLengthValue;
|
|
1643
|
+
const rawDataValue = (yield* codecParser[readRawData](totalLength, 0))[subarray](0, totalLength);
|
|
1644
|
+
const frame2 = rawDataValue[subarray](headerLength, totalLength);
|
|
1645
|
+
return new _OggPage(header2, frame2, rawDataValue);
|
|
1646
|
+
} else {
|
|
1647
|
+
return null;
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
constructor(header2, frame2, rawDataValue) {
|
|
1651
|
+
super(header2, frame2);
|
|
1652
|
+
frameStore.get(this)[length] = rawDataValue[length];
|
|
1653
|
+
this[codecFrames] = [];
|
|
1654
|
+
this[rawData] = rawDataValue;
|
|
1655
|
+
this[absoluteGranulePosition] = header2[absoluteGranulePosition];
|
|
1656
|
+
this[crc32] = header2[pageChecksum];
|
|
1657
|
+
this[duration] = 0;
|
|
1658
|
+
this[isContinuedPacket] = header2[isContinuedPacket];
|
|
1659
|
+
this[isFirstPage] = header2[isFirstPage];
|
|
1660
|
+
this[isLastPage] = header2[isLastPage];
|
|
1661
|
+
this[pageSequenceNumber] = header2[pageSequenceNumber];
|
|
1662
|
+
this[samples] = 0;
|
|
1663
|
+
this[streamSerialNumber] = header2[streamSerialNumber];
|
|
1664
|
+
}
|
|
1665
|
+
};
|
|
1666
|
+
|
|
1667
|
+
// ../../node_modules/codec-parser/src/codecs/opus/OpusParser.js
|
|
1668
|
+
init_text_decoder();
|
|
1669
|
+
|
|
1670
|
+
// ../../node_modules/codec-parser/src/codecs/opus/OpusFrame.js
|
|
1671
|
+
init_text_decoder();
|
|
1672
|
+
var OpusFrame = class extends CodecFrame {
|
|
1673
|
+
constructor(data3, header2, samples3) {
|
|
1674
|
+
super(header2, data3, samples3);
|
|
1675
|
+
}
|
|
1676
|
+
};
|
|
1677
|
+
|
|
1678
|
+
// ../../node_modules/codec-parser/src/codecs/opus/OpusHeader.js
|
|
1679
|
+
init_text_decoder();
|
|
1680
|
+
var channelMappingFamilies = {
|
|
1681
|
+
0: vorbisOpusChannelMapping.slice(0, 2),
|
|
1682
|
+
/*
|
|
1683
|
+
0: "monophonic (mono)"
|
|
1684
|
+
1: "stereo (left, right)"
|
|
1685
|
+
*/
|
|
1686
|
+
1: vorbisOpusChannelMapping
|
|
1687
|
+
/*
|
|
1688
|
+
0: "monophonic (mono)"
|
|
1689
|
+
1: "stereo (left, right)"
|
|
1690
|
+
2: "linear surround (left, center, right)"
|
|
1691
|
+
3: "quadraphonic (front left, front right, rear left, rear right)"
|
|
1692
|
+
4: "5.0 surround (front left, front center, front right, rear left, rear right)"
|
|
1693
|
+
5: "5.1 surround (front left, front center, front right, rear left, rear right, LFE)"
|
|
1694
|
+
6: "6.1 surround (front left, front center, front right, side left, side right, rear center, LFE)"
|
|
1695
|
+
7: "7.1 surround (front left, front center, front right, side left, side right, rear left, rear right, LFE)"
|
|
1696
|
+
*/
|
|
1697
|
+
// additional channel mappings are user defined
|
|
1698
|
+
};
|
|
1699
|
+
var silkOnly = "SILK-only";
|
|
1700
|
+
var celtOnly = "CELT-only";
|
|
1701
|
+
var hybrid = "Hybrid";
|
|
1702
|
+
var narrowBand = "narrowband";
|
|
1703
|
+
var mediumBand = "medium-band";
|
|
1704
|
+
var wideBand = "wideband";
|
|
1705
|
+
var superWideBand = "super-wideband";
|
|
1706
|
+
var fullBand = "fullband";
|
|
1707
|
+
var configTable = {
|
|
1708
|
+
0: { [mode]: silkOnly, [bandwidth]: narrowBand, [frameSize]: 10 },
|
|
1709
|
+
8: { [mode]: silkOnly, [bandwidth]: narrowBand, [frameSize]: 20 },
|
|
1710
|
+
16: { [mode]: silkOnly, [bandwidth]: narrowBand, [frameSize]: 40 },
|
|
1711
|
+
24: { [mode]: silkOnly, [bandwidth]: narrowBand, [frameSize]: 60 },
|
|
1712
|
+
32: { [mode]: silkOnly, [bandwidth]: mediumBand, [frameSize]: 10 },
|
|
1713
|
+
40: { [mode]: silkOnly, [bandwidth]: mediumBand, [frameSize]: 20 },
|
|
1714
|
+
48: { [mode]: silkOnly, [bandwidth]: mediumBand, [frameSize]: 40 },
|
|
1715
|
+
56: { [mode]: silkOnly, [bandwidth]: mediumBand, [frameSize]: 60 },
|
|
1716
|
+
64: { [mode]: silkOnly, [bandwidth]: wideBand, [frameSize]: 10 },
|
|
1717
|
+
72: { [mode]: silkOnly, [bandwidth]: wideBand, [frameSize]: 20 },
|
|
1718
|
+
80: { [mode]: silkOnly, [bandwidth]: wideBand, [frameSize]: 40 },
|
|
1719
|
+
88: { [mode]: silkOnly, [bandwidth]: wideBand, [frameSize]: 60 },
|
|
1720
|
+
96: { [mode]: hybrid, [bandwidth]: superWideBand, [frameSize]: 10 },
|
|
1721
|
+
104: { [mode]: hybrid, [bandwidth]: superWideBand, [frameSize]: 20 },
|
|
1722
|
+
112: { [mode]: hybrid, [bandwidth]: fullBand, [frameSize]: 10 },
|
|
1723
|
+
120: { [mode]: hybrid, [bandwidth]: fullBand, [frameSize]: 20 },
|
|
1724
|
+
128: { [mode]: celtOnly, [bandwidth]: narrowBand, [frameSize]: 2.5 },
|
|
1725
|
+
136: { [mode]: celtOnly, [bandwidth]: narrowBand, [frameSize]: 5 },
|
|
1726
|
+
144: { [mode]: celtOnly, [bandwidth]: narrowBand, [frameSize]: 10 },
|
|
1727
|
+
152: { [mode]: celtOnly, [bandwidth]: narrowBand, [frameSize]: 20 },
|
|
1728
|
+
160: { [mode]: celtOnly, [bandwidth]: wideBand, [frameSize]: 2.5 },
|
|
1729
|
+
168: { [mode]: celtOnly, [bandwidth]: wideBand, [frameSize]: 5 },
|
|
1730
|
+
176: { [mode]: celtOnly, [bandwidth]: wideBand, [frameSize]: 10 },
|
|
1731
|
+
184: { [mode]: celtOnly, [bandwidth]: wideBand, [frameSize]: 20 },
|
|
1732
|
+
192: { [mode]: celtOnly, [bandwidth]: superWideBand, [frameSize]: 2.5 },
|
|
1733
|
+
200: { [mode]: celtOnly, [bandwidth]: superWideBand, [frameSize]: 5 },
|
|
1734
|
+
208: { [mode]: celtOnly, [bandwidth]: superWideBand, [frameSize]: 10 },
|
|
1735
|
+
216: { [mode]: celtOnly, [bandwidth]: superWideBand, [frameSize]: 20 },
|
|
1736
|
+
224: { [mode]: celtOnly, [bandwidth]: fullBand, [frameSize]: 2.5 },
|
|
1737
|
+
232: { [mode]: celtOnly, [bandwidth]: fullBand, [frameSize]: 5 },
|
|
1738
|
+
240: { [mode]: celtOnly, [bandwidth]: fullBand, [frameSize]: 10 },
|
|
1739
|
+
248: { [mode]: celtOnly, [bandwidth]: fullBand, [frameSize]: 20 }
|
|
1740
|
+
};
|
|
1741
|
+
var OpusHeader = class _OpusHeader extends CodecHeader {
|
|
1742
|
+
static [getHeaderFromUint8Array](dataValue, packetData, headerCache) {
|
|
1743
|
+
const header2 = {};
|
|
1744
|
+
header2[channels] = dataValue[9];
|
|
1745
|
+
header2[channelMappingFamily] = dataValue[18];
|
|
1746
|
+
header2[length] = header2[channelMappingFamily] !== 0 ? 21 + header2[channels] : 19;
|
|
1747
|
+
if (dataValue[length] < header2[length])
|
|
1748
|
+
throw new Error("Out of data while inside an Ogg Page");
|
|
1749
|
+
const packetMode = packetData[0] & 3;
|
|
1750
|
+
const packetLength = packetMode === 3 ? 2 : 1;
|
|
1751
|
+
const key = bytesToString(dataValue[subarray](0, header2[length])) + bytesToString(packetData[subarray](0, packetLength));
|
|
1752
|
+
const cachedHeader = headerCache[getHeader](key);
|
|
1753
|
+
if (cachedHeader) return new _OpusHeader(cachedHeader);
|
|
1754
|
+
if (key.substr(0, 8) !== "OpusHead") {
|
|
1755
|
+
return null;
|
|
1756
|
+
}
|
|
1757
|
+
if (dataValue[8] !== 1) return null;
|
|
1758
|
+
header2[data] = uint8Array.from(dataValue[subarray](0, header2[length]));
|
|
1759
|
+
const view = new dataView(header2[data][buffer]);
|
|
1760
|
+
header2[bitDepth] = 16;
|
|
1761
|
+
header2[preSkip] = view.getUint16(10, true);
|
|
1762
|
+
header2[inputSampleRate] = view.getUint32(12, true);
|
|
1763
|
+
header2[sampleRate] = rate48000;
|
|
1764
|
+
header2[outputGain] = view.getInt16(16, true);
|
|
1765
|
+
if (header2[channelMappingFamily] in channelMappingFamilies) {
|
|
1766
|
+
header2[channelMode] = channelMappingFamilies[header2[channelMappingFamily]][header2[channels] - 1];
|
|
1767
|
+
if (!header2[channelMode]) return null;
|
|
1768
|
+
}
|
|
1769
|
+
if (header2[channelMappingFamily] !== 0) {
|
|
1770
|
+
header2[streamCount] = dataValue[19];
|
|
1771
|
+
header2[coupledStreamCount] = dataValue[20];
|
|
1772
|
+
header2[channelMappingTable] = [
|
|
1773
|
+
...dataValue[subarray](21, header2[channels] + 21)
|
|
1774
|
+
];
|
|
1775
|
+
}
|
|
1776
|
+
const packetConfig = configTable[248 & packetData[0]];
|
|
1777
|
+
header2[mode] = packetConfig[mode];
|
|
1778
|
+
header2[bandwidth] = packetConfig[bandwidth];
|
|
1779
|
+
header2[frameSize] = packetConfig[frameSize];
|
|
1780
|
+
switch (packetMode) {
|
|
1781
|
+
case 0:
|
|
1782
|
+
header2[frameCount] = 1;
|
|
1783
|
+
break;
|
|
1784
|
+
case 1:
|
|
1785
|
+
// 1: 2 frames in the packet, each with equal compressed size
|
|
1786
|
+
case 2:
|
|
1787
|
+
header2[frameCount] = 2;
|
|
1788
|
+
break;
|
|
1789
|
+
case 3:
|
|
1790
|
+
header2[isVbr] = !!(128 & packetData[1]);
|
|
1791
|
+
header2[hasOpusPadding] = !!(64 & packetData[1]);
|
|
1792
|
+
header2[frameCount] = 63 & packetData[1];
|
|
1793
|
+
break;
|
|
1794
|
+
default:
|
|
1795
|
+
return null;
|
|
1796
|
+
}
|
|
1797
|
+
{
|
|
1798
|
+
const {
|
|
1799
|
+
length: length2,
|
|
1800
|
+
data: headerData,
|
|
1801
|
+
channelMappingFamily: channelMappingFamily2,
|
|
1802
|
+
...codecUpdateFields
|
|
1803
|
+
} = header2;
|
|
1804
|
+
headerCache[setHeader](key, header2, codecUpdateFields);
|
|
1805
|
+
}
|
|
1806
|
+
return new _OpusHeader(header2);
|
|
1807
|
+
}
|
|
1808
|
+
/**
|
|
1809
|
+
* @private
|
|
1810
|
+
* Call OpusHeader.getHeader(Array<Uint8>) to get instance
|
|
1811
|
+
*/
|
|
1812
|
+
constructor(header2) {
|
|
1813
|
+
super(header2);
|
|
1814
|
+
this[data] = header2[data];
|
|
1815
|
+
this[bandwidth] = header2[bandwidth];
|
|
1816
|
+
this[channelMappingFamily] = header2[channelMappingFamily];
|
|
1817
|
+
this[channelMappingTable] = header2[channelMappingTable];
|
|
1818
|
+
this[coupledStreamCount] = header2[coupledStreamCount];
|
|
1819
|
+
this[frameCount] = header2[frameCount];
|
|
1820
|
+
this[frameSize] = header2[frameSize];
|
|
1821
|
+
this[hasOpusPadding] = header2[hasOpusPadding];
|
|
1822
|
+
this[inputSampleRate] = header2[inputSampleRate];
|
|
1823
|
+
this[isVbr] = header2[isVbr];
|
|
1824
|
+
this[mode] = header2[mode];
|
|
1825
|
+
this[outputGain] = header2[outputGain];
|
|
1826
|
+
this[preSkip] = header2[preSkip];
|
|
1827
|
+
this[streamCount] = header2[streamCount];
|
|
1828
|
+
}
|
|
1829
|
+
};
|
|
1830
|
+
|
|
1831
|
+
// ../../node_modules/codec-parser/src/codecs/opus/OpusParser.js
|
|
1832
|
+
var OpusParser = class extends Parser {
|
|
1833
|
+
constructor(codecParser, headerCache, onCodec) {
|
|
1834
|
+
super(codecParser, headerCache);
|
|
1835
|
+
this.Frame = OpusFrame;
|
|
1836
|
+
this.Header = OpusHeader;
|
|
1837
|
+
onCodec(this[codec]);
|
|
1838
|
+
this._identificationHeader = null;
|
|
1839
|
+
this._preSkipRemaining = null;
|
|
1840
|
+
}
|
|
1841
|
+
get [codec]() {
|
|
1842
|
+
return "opus";
|
|
1843
|
+
}
|
|
1844
|
+
/**
|
|
1845
|
+
* @todo implement continued page support
|
|
1846
|
+
*/
|
|
1847
|
+
[parseOggPage](oggPage) {
|
|
1848
|
+
if (oggPage[pageSequenceNumber] === 0) {
|
|
1849
|
+
this._headerCache[enable]();
|
|
1850
|
+
this._identificationHeader = oggPage[data];
|
|
1851
|
+
} else if (oggPage[pageSequenceNumber] === 1) {
|
|
1852
|
+
} else {
|
|
1853
|
+
oggPage[codecFrames] = frameStore.get(oggPage)[segments].map((segment) => {
|
|
1854
|
+
const header2 = OpusHeader[getHeaderFromUint8Array](
|
|
1855
|
+
this._identificationHeader,
|
|
1856
|
+
segment,
|
|
1857
|
+
this._headerCache
|
|
1858
|
+
);
|
|
1859
|
+
if (header2) {
|
|
1860
|
+
if (this._preSkipRemaining === null)
|
|
1861
|
+
this._preSkipRemaining = header2[preSkip];
|
|
1862
|
+
let samples3 = header2[frameSize] * header2[frameCount] / 1e3 * header2[sampleRate];
|
|
1863
|
+
if (this._preSkipRemaining > 0) {
|
|
1864
|
+
this._preSkipRemaining -= samples3;
|
|
1865
|
+
samples3 = this._preSkipRemaining < 0 ? -this._preSkipRemaining : 0;
|
|
1866
|
+
}
|
|
1867
|
+
return new OpusFrame(segment, header2, samples3);
|
|
1868
|
+
}
|
|
1869
|
+
this._codecParser[logError2](
|
|
1870
|
+
"Failed to parse Ogg Opus Header",
|
|
1871
|
+
"Not a valid Ogg Opus file"
|
|
1872
|
+
);
|
|
1873
|
+
});
|
|
1874
|
+
}
|
|
1875
|
+
return oggPage;
|
|
1876
|
+
}
|
|
1877
|
+
};
|
|
1878
|
+
|
|
1879
|
+
// ../../node_modules/codec-parser/src/codecs/vorbis/VorbisParser.js
|
|
1880
|
+
init_text_decoder();
|
|
1881
|
+
|
|
1882
|
+
// ../../node_modules/codec-parser/src/codecs/vorbis/VorbisFrame.js
|
|
1883
|
+
init_text_decoder();
|
|
1884
|
+
var VorbisFrame = class extends CodecFrame {
|
|
1885
|
+
constructor(data3, header2, samples3) {
|
|
1886
|
+
super(header2, data3, samples3);
|
|
1887
|
+
}
|
|
1888
|
+
};
|
|
1889
|
+
|
|
1890
|
+
// ../../node_modules/codec-parser/src/codecs/vorbis/VorbisHeader.js
|
|
1891
|
+
init_text_decoder();
|
|
1892
|
+
var blockSizes = {
|
|
1893
|
+
// 0b0110: 64,
|
|
1894
|
+
// 0b0111: 128,
|
|
1895
|
+
// 0b1000: 256,
|
|
1896
|
+
// 0b1001: 512,
|
|
1897
|
+
// 0b1010: 1024,
|
|
1898
|
+
// 0b1011: 2048,
|
|
1899
|
+
// 0b1100: 4096,
|
|
1900
|
+
// 0b1101: 8192
|
|
1901
|
+
};
|
|
1902
|
+
for (let i = 0; i < 8; i++) blockSizes[i + 6] = 2 ** (6 + i);
|
|
1903
|
+
var VorbisHeader = class _VorbisHeader extends CodecHeader {
|
|
1904
|
+
static [getHeaderFromUint8Array](dataValue, headerCache, vorbisCommentsData, vorbisSetupData) {
|
|
1905
|
+
if (dataValue[length] < 30)
|
|
1906
|
+
throw new Error("Out of data while inside an Ogg Page");
|
|
1907
|
+
const key = bytesToString(dataValue[subarray](0, 30));
|
|
1908
|
+
const cachedHeader = headerCache[getHeader](key);
|
|
1909
|
+
if (cachedHeader) return new _VorbisHeader(cachedHeader);
|
|
1910
|
+
const header2 = { [length]: 30 };
|
|
1911
|
+
if (key.substr(0, 7) !== "vorbis") {
|
|
1912
|
+
return null;
|
|
1913
|
+
}
|
|
1914
|
+
header2[data] = uint8Array.from(dataValue[subarray](0, 30));
|
|
1915
|
+
const view = new dataView(header2[data][buffer]);
|
|
1916
|
+
header2[version] = view.getUint32(7, true);
|
|
1917
|
+
if (header2[version] !== 0) return null;
|
|
1918
|
+
header2[channels] = dataValue[11];
|
|
1919
|
+
header2[channelMode] = vorbisOpusChannelMapping[header2[channels] - 1] || "application defined";
|
|
1920
|
+
header2[sampleRate] = view.getUint32(12, true);
|
|
1921
|
+
header2[bitrateMaximum] = view.getInt32(16, true);
|
|
1922
|
+
header2[bitrateNominal] = view.getInt32(20, true);
|
|
1923
|
+
header2[bitrateMinimum] = view.getInt32(24, true);
|
|
1924
|
+
header2[blocksize1] = blockSizes[(dataValue[28] & 240) >> 4];
|
|
1925
|
+
header2[blocksize0] = blockSizes[dataValue[28] & 15];
|
|
1926
|
+
if (header2[blocksize0] > header2[blocksize1]) return null;
|
|
1927
|
+
if (dataValue[29] !== 1) return null;
|
|
1928
|
+
header2[bitDepth] = 32;
|
|
1929
|
+
header2[vorbisSetup] = vorbisSetupData;
|
|
1930
|
+
header2[vorbisComments] = vorbisCommentsData;
|
|
1931
|
+
{
|
|
1932
|
+
const {
|
|
1933
|
+
length: length2,
|
|
1934
|
+
data: data3,
|
|
1935
|
+
version: version2,
|
|
1936
|
+
vorbisSetup: vorbisSetup2,
|
|
1937
|
+
vorbisComments: vorbisComments2,
|
|
1938
|
+
...codecUpdateFields
|
|
1939
|
+
} = header2;
|
|
1940
|
+
headerCache[setHeader](key, header2, codecUpdateFields);
|
|
1941
|
+
}
|
|
1942
|
+
return new _VorbisHeader(header2);
|
|
1943
|
+
}
|
|
1944
|
+
/**
|
|
1945
|
+
* @private
|
|
1946
|
+
* Call VorbisHeader.getHeader(Array<Uint8>) to get instance
|
|
1947
|
+
*/
|
|
1948
|
+
constructor(header2) {
|
|
1949
|
+
super(header2);
|
|
1950
|
+
this[bitrateMaximum] = header2[bitrateMaximum];
|
|
1951
|
+
this[bitrateMinimum] = header2[bitrateMinimum];
|
|
1952
|
+
this[bitrateNominal] = header2[bitrateNominal];
|
|
1953
|
+
this[blocksize0] = header2[blocksize0];
|
|
1954
|
+
this[blocksize1] = header2[blocksize1];
|
|
1955
|
+
this[data] = header2[data];
|
|
1956
|
+
this[vorbisComments] = header2[vorbisComments];
|
|
1957
|
+
this[vorbisSetup] = header2[vorbisSetup];
|
|
1958
|
+
}
|
|
1959
|
+
};
|
|
1960
|
+
|
|
1961
|
+
// ../../node_modules/codec-parser/src/codecs/vorbis/VorbisParser.js
|
|
1962
|
+
var VorbisParser = class extends Parser {
|
|
1963
|
+
constructor(codecParser, headerCache, onCodec) {
|
|
1964
|
+
super(codecParser, headerCache);
|
|
1965
|
+
this.Frame = VorbisFrame;
|
|
1966
|
+
onCodec(this[codec]);
|
|
1967
|
+
this._identificationHeader = null;
|
|
1968
|
+
this._setupComplete = false;
|
|
1969
|
+
this._prevBlockSize = null;
|
|
1970
|
+
}
|
|
1971
|
+
get [codec]() {
|
|
1972
|
+
return vorbis;
|
|
1973
|
+
}
|
|
1974
|
+
[parseOggPage](oggPage) {
|
|
1975
|
+
oggPage[codecFrames] = [];
|
|
1976
|
+
for (const oggPageSegment of frameStore.get(oggPage)[segments]) {
|
|
1977
|
+
if (oggPageSegment[0] === 1) {
|
|
1978
|
+
this._headerCache[enable]();
|
|
1979
|
+
this._identificationHeader = oggPage[data];
|
|
1980
|
+
this._setupComplete = false;
|
|
1981
|
+
} else if (oggPageSegment[0] === 3) {
|
|
1982
|
+
this._vorbisComments = oggPageSegment;
|
|
1983
|
+
} else if (oggPageSegment[0] === 5) {
|
|
1984
|
+
this._vorbisSetup = oggPageSegment;
|
|
1985
|
+
this._mode = this._parseSetupHeader(oggPageSegment);
|
|
1986
|
+
this._setupComplete = true;
|
|
1987
|
+
} else if (this._setupComplete) {
|
|
1988
|
+
const header2 = VorbisHeader[getHeaderFromUint8Array](
|
|
1989
|
+
this._identificationHeader,
|
|
1990
|
+
this._headerCache,
|
|
1991
|
+
this._vorbisComments,
|
|
1992
|
+
this._vorbisSetup
|
|
1993
|
+
);
|
|
1994
|
+
if (header2) {
|
|
1995
|
+
oggPage[codecFrames].push(
|
|
1996
|
+
new VorbisFrame(
|
|
1997
|
+
oggPageSegment,
|
|
1998
|
+
header2,
|
|
1999
|
+
this._getSamples(oggPageSegment, header2)
|
|
2000
|
+
)
|
|
2001
|
+
);
|
|
2002
|
+
} else {
|
|
2003
|
+
this._codecParser[logError](
|
|
2004
|
+
"Failed to parse Ogg Vorbis Header",
|
|
2005
|
+
"Not a valid Ogg Vorbis file"
|
|
2006
|
+
);
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
return oggPage;
|
|
2011
|
+
}
|
|
2012
|
+
_getSamples(segment, header2) {
|
|
2013
|
+
const blockFlag = this._mode.blockFlags[segment[0] >> 1 & this._mode.mask];
|
|
2014
|
+
const currentBlockSize = blockFlag ? header2[blocksize1] : header2[blocksize0];
|
|
2015
|
+
const samplesValue = this._prevBlockSize === null ? 0 : (this._prevBlockSize + currentBlockSize) / 4;
|
|
2016
|
+
this._prevBlockSize = currentBlockSize;
|
|
2017
|
+
return samplesValue;
|
|
2018
|
+
}
|
|
2019
|
+
// https://gitlab.xiph.org/xiph/liboggz/-/blob/master/src/liboggz/oggz_auto.c#L911
|
|
2020
|
+
// https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/vorbis_parser.c
|
|
2021
|
+
/*
|
|
2022
|
+
* This is the format of the mode data at the end of the packet for all
|
|
2023
|
+
* Vorbis Version 1 :
|
|
2024
|
+
*
|
|
2025
|
+
* [ 6:number_of_modes ]
|
|
2026
|
+
* [ 1:size | 16:window_type(0) | 16:transform_type(0) | 8:mapping ]
|
|
2027
|
+
* [ 1:size | 16:window_type(0) | 16:transform_type(0) | 8:mapping ]
|
|
2028
|
+
* [ 1:size | 16:window_type(0) | 16:transform_type(0) | 8:mapping ]
|
|
2029
|
+
* [ 1:framing(1) ]
|
|
2030
|
+
*
|
|
2031
|
+
* e.g.:
|
|
2032
|
+
*
|
|
2033
|
+
* MsB LsB
|
|
2034
|
+
* <-
|
|
2035
|
+
* 0 0 0 0 0 1 0 0
|
|
2036
|
+
* 0 0 1 0 0 0 0 0
|
|
2037
|
+
* 0 0 1 0 0 0 0 0
|
|
2038
|
+
* 0 0 1|0 0 0 0 0
|
|
2039
|
+
* 0 0 0 0|0|0 0 0
|
|
2040
|
+
* 0 0 0 0 0 0 0 0
|
|
2041
|
+
* 0 0 0 0|0 0 0 0
|
|
2042
|
+
* 0 0 0 0 0 0 0 0
|
|
2043
|
+
* 0 0 0 0|0 0 0 0
|
|
2044
|
+
* 0 0 0|1|0 0 0 0 |
|
|
2045
|
+
* 0 0 0 0 0 0 0 0 V
|
|
2046
|
+
* 0 0 0|0 0 0 0 0
|
|
2047
|
+
* 0 0 0 0 0 0 0 0
|
|
2048
|
+
* 0 0|1 0 0 0 0 0
|
|
2049
|
+
*
|
|
2050
|
+
* The simplest way to approach this is to start at the end
|
|
2051
|
+
* and read backwards to determine the mode configuration.
|
|
2052
|
+
*
|
|
2053
|
+
* liboggz and ffmpeg both use this method.
|
|
2054
|
+
*/
|
|
2055
|
+
_parseSetupHeader(setup) {
|
|
2056
|
+
const bitReader = new BitReader(setup);
|
|
2057
|
+
const mode2 = {
|
|
2058
|
+
count: 0,
|
|
2059
|
+
blockFlags: []
|
|
2060
|
+
};
|
|
2061
|
+
while ((bitReader.read(1) & 1) !== 1) {
|
|
2062
|
+
}
|
|
2063
|
+
let modeBits;
|
|
2064
|
+
while (mode2.count < 64 && bitReader.position > 0) {
|
|
2065
|
+
reverse(bitReader.read(8));
|
|
2066
|
+
let currentByte = 0;
|
|
2067
|
+
while (bitReader.read(8) === 0 && currentByte++ < 3) {
|
|
2068
|
+
}
|
|
2069
|
+
if (currentByte === 4) {
|
|
2070
|
+
modeBits = bitReader.read(7);
|
|
2071
|
+
mode2.blockFlags.unshift(modeBits & 1);
|
|
2072
|
+
bitReader.position += 6;
|
|
2073
|
+
mode2.count++;
|
|
2074
|
+
} else {
|
|
2075
|
+
if (((reverse(modeBits) & 126) >> 1) + 1 !== mode2.count) {
|
|
2076
|
+
this._codecParser[logWarning](
|
|
2077
|
+
"vorbis derived mode count did not match actual mode count"
|
|
2078
|
+
);
|
|
2079
|
+
}
|
|
2080
|
+
break;
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
mode2.mask = (1 << Math.log2(mode2.count)) - 1;
|
|
2084
|
+
return mode2;
|
|
2085
|
+
}
|
|
2086
|
+
};
|
|
2087
|
+
|
|
2088
|
+
// ../../node_modules/codec-parser/src/containers/ogg/OggParser.js
|
|
2089
|
+
var OggStream = class {
|
|
2090
|
+
constructor(codecParser, headerCache, onCodec) {
|
|
2091
|
+
this._codecParser = codecParser;
|
|
2092
|
+
this._headerCache = headerCache;
|
|
2093
|
+
this._onCodec = onCodec;
|
|
2094
|
+
this._continuedPacket = new uint8Array();
|
|
2095
|
+
this._codec = null;
|
|
2096
|
+
this._isSupported = null;
|
|
2097
|
+
this._previousAbsoluteGranulePosition = null;
|
|
2098
|
+
}
|
|
2099
|
+
get [codec]() {
|
|
2100
|
+
return this._codec || "";
|
|
2101
|
+
}
|
|
2102
|
+
_updateCodec(codec2, Parser2) {
|
|
2103
|
+
if (this._codec !== codec2) {
|
|
2104
|
+
this._headerCache[reset]();
|
|
2105
|
+
this._parser = new Parser2(
|
|
2106
|
+
this._codecParser,
|
|
2107
|
+
this._headerCache,
|
|
2108
|
+
this._onCodec
|
|
2109
|
+
);
|
|
2110
|
+
this._codec = codec2;
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
_checkCodecSupport({ data: data3 }) {
|
|
2114
|
+
const idString = bytesToString(data3[subarray](0, 8));
|
|
2115
|
+
switch (idString) {
|
|
2116
|
+
case "fishead\0":
|
|
2117
|
+
return false;
|
|
2118
|
+
// ignore ogg skeleton packets
|
|
2119
|
+
case "OpusHead":
|
|
2120
|
+
this._updateCodec("opus", OpusParser);
|
|
2121
|
+
return true;
|
|
2122
|
+
case (/^\x7fFLAC/.test(idString) && idString):
|
|
2123
|
+
this._updateCodec("flac", FLACParser);
|
|
2124
|
+
return true;
|
|
2125
|
+
case (/^\x01vorbis/.test(idString) && idString):
|
|
2126
|
+
this._updateCodec(vorbis, VorbisParser);
|
|
2127
|
+
return true;
|
|
2128
|
+
default:
|
|
2129
|
+
return false;
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
_checkPageSequenceNumber(oggPage) {
|
|
2133
|
+
if (oggPage[pageSequenceNumber] !== this._pageSequenceNumber + 1 && this._pageSequenceNumber > 1 && oggPage[pageSequenceNumber] > 1) {
|
|
2134
|
+
this._codecParser[logWarning](
|
|
2135
|
+
"Unexpected gap in Ogg Page Sequence Number.",
|
|
2136
|
+
`Expected: ${this._pageSequenceNumber + 1}, Got: ${oggPage[pageSequenceNumber]}`
|
|
2137
|
+
);
|
|
2138
|
+
}
|
|
2139
|
+
this._pageSequenceNumber = oggPage[pageSequenceNumber];
|
|
2140
|
+
}
|
|
2141
|
+
_parsePage(oggPage) {
|
|
2142
|
+
if (this._isSupported === null) {
|
|
2143
|
+
this._pageSequenceNumber = oggPage[pageSequenceNumber];
|
|
2144
|
+
this._isSupported = this._checkCodecSupport(oggPage);
|
|
2145
|
+
}
|
|
2146
|
+
this._checkPageSequenceNumber(oggPage);
|
|
2147
|
+
const oggPageStore = frameStore.get(oggPage);
|
|
2148
|
+
const headerData = headerStore.get(oggPageStore[header]);
|
|
2149
|
+
let offset = 0;
|
|
2150
|
+
oggPageStore[segments] = headerData[pageSegmentTable].map(
|
|
2151
|
+
(segmentLength) => oggPage[data][subarray](offset, offset += segmentLength)
|
|
2152
|
+
);
|
|
2153
|
+
if (this._continuedPacket[length]) {
|
|
2154
|
+
oggPageStore[segments][0] = concatBuffers(
|
|
2155
|
+
this._continuedPacket,
|
|
2156
|
+
oggPageStore[segments][0]
|
|
2157
|
+
);
|
|
2158
|
+
this._continuedPacket = new uint8Array();
|
|
2159
|
+
}
|
|
2160
|
+
if (headerData[pageSegmentBytes][headerData[pageSegmentBytes][length] - 1] === 255) {
|
|
2161
|
+
this._continuedPacket = concatBuffers(
|
|
2162
|
+
this._continuedPacket,
|
|
2163
|
+
oggPageStore[segments].pop()
|
|
2164
|
+
);
|
|
2165
|
+
}
|
|
2166
|
+
if (this._previousAbsoluteGranulePosition !== null) {
|
|
2167
|
+
oggPage[samples] = Number(
|
|
2168
|
+
oggPage[absoluteGranulePosition] - this._previousAbsoluteGranulePosition
|
|
2169
|
+
);
|
|
2170
|
+
}
|
|
2171
|
+
this._previousAbsoluteGranulePosition = oggPage[absoluteGranulePosition];
|
|
2172
|
+
if (this._isSupported) {
|
|
2173
|
+
const frame2 = this._parser[parseOggPage](oggPage);
|
|
2174
|
+
this._codecParser[mapFrameStats](frame2);
|
|
2175
|
+
return frame2;
|
|
2176
|
+
} else {
|
|
2177
|
+
return oggPage;
|
|
2178
|
+
}
|
|
2179
|
+
}
|
|
2180
|
+
};
|
|
2181
|
+
var OggParser = class extends Parser {
|
|
2182
|
+
constructor(codecParser, headerCache, onCodec) {
|
|
2183
|
+
super(codecParser, headerCache);
|
|
2184
|
+
this._onCodec = onCodec;
|
|
2185
|
+
this.Frame = OggPage;
|
|
2186
|
+
this.Header = OggPageHeader;
|
|
2187
|
+
this._streams = /* @__PURE__ */ new Map();
|
|
2188
|
+
this._currentSerialNumber = null;
|
|
2189
|
+
}
|
|
2190
|
+
get [codec]() {
|
|
2191
|
+
const oggStream = this._streams.get(this._currentSerialNumber);
|
|
2192
|
+
return oggStream ? oggStream.codec : "";
|
|
2193
|
+
}
|
|
2194
|
+
*[parseFrame]() {
|
|
2195
|
+
const oggPage = yield* this[fixedLengthFrameSync](true);
|
|
2196
|
+
this._currentSerialNumber = oggPage[streamSerialNumber];
|
|
2197
|
+
let oggStream = this._streams.get(this._currentSerialNumber);
|
|
2198
|
+
if (!oggStream) {
|
|
2199
|
+
oggStream = new OggStream(
|
|
2200
|
+
this._codecParser,
|
|
2201
|
+
this._headerCache,
|
|
2202
|
+
this._onCodec
|
|
2203
|
+
);
|
|
2204
|
+
this._streams.set(this._currentSerialNumber, oggStream);
|
|
2205
|
+
}
|
|
2206
|
+
if (oggPage[isLastPage]) this._streams.delete(this._currentSerialNumber);
|
|
2207
|
+
return oggStream._parsePage(oggPage);
|
|
2208
|
+
}
|
|
2209
|
+
};
|
|
2210
|
+
|
|
2211
|
+
// ../../node_modules/codec-parser/src/CodecParser.js
|
|
2212
|
+
var noOp = () => {
|
|
2213
|
+
};
|
|
2214
|
+
var CodecParser = class {
|
|
2215
|
+
constructor(mimeType2, {
|
|
2216
|
+
onCodec,
|
|
2217
|
+
onCodecHeader,
|
|
2218
|
+
onCodecUpdate,
|
|
2219
|
+
enableLogging = false,
|
|
2220
|
+
enableFrameCRC32 = true
|
|
2221
|
+
} = {}) {
|
|
2222
|
+
this._inputMimeType = mimeType2;
|
|
2223
|
+
this._onCodec = onCodec || noOp;
|
|
2224
|
+
this._onCodecHeader = onCodecHeader || noOp;
|
|
2225
|
+
this._onCodecUpdate = onCodecUpdate;
|
|
2226
|
+
this._enableLogging = enableLogging;
|
|
2227
|
+
this._crc32 = enableFrameCRC32 ? crc32Function : noOp;
|
|
2228
|
+
this[reset]();
|
|
2229
|
+
}
|
|
2230
|
+
/**
|
|
2231
|
+
* @public
|
|
2232
|
+
* @returns The detected codec
|
|
2233
|
+
*/
|
|
2234
|
+
get [codec]() {
|
|
2235
|
+
return this._parser ? this._parser[codec] : "";
|
|
2236
|
+
}
|
|
2237
|
+
[reset]() {
|
|
2238
|
+
this._headerCache = new HeaderCache(
|
|
2239
|
+
this._onCodecHeader,
|
|
2240
|
+
this._onCodecUpdate
|
|
2241
|
+
);
|
|
2242
|
+
this._generator = this._getGenerator();
|
|
2243
|
+
this._generator.next();
|
|
2244
|
+
}
|
|
2245
|
+
/**
|
|
2246
|
+
* @public
|
|
2247
|
+
* @description Generator function that yields any buffered CodecFrames and resets the CodecParser
|
|
2248
|
+
* @returns {Iterable<CodecFrame|OggPage>} Iterator that operates over the codec data.
|
|
2249
|
+
* @yields {CodecFrame|OggPage} Parsed codec or ogg page data
|
|
2250
|
+
*/
|
|
2251
|
+
*flush() {
|
|
2252
|
+
this._flushing = true;
|
|
2253
|
+
for (let i = this._generator.next(); i.value; i = this._generator.next()) {
|
|
2254
|
+
yield i.value;
|
|
2255
|
+
}
|
|
2256
|
+
this._flushing = false;
|
|
2257
|
+
this[reset]();
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* @public
|
|
2261
|
+
* @description Generator function takes in a Uint8Array of data and returns a CodecFrame from the data for each iteration
|
|
2262
|
+
* @param {Uint8Array} chunk Next chunk of codec data to read
|
|
2263
|
+
* @returns {Iterable<CodecFrame|OggPage>} Iterator that operates over the codec data.
|
|
2264
|
+
* @yields {CodecFrame|OggPage} Parsed codec or ogg page data
|
|
2265
|
+
*/
|
|
2266
|
+
*parseChunk(chunk) {
|
|
2267
|
+
for (let i = this._generator.next(chunk); i.value; i = this._generator.next()) {
|
|
2268
|
+
yield i.value;
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
/**
|
|
2272
|
+
* @public
|
|
2273
|
+
* @description Parses an entire file and returns all of the contained frames.
|
|
2274
|
+
* @param {Uint8Array} fileData Coded data to read
|
|
2275
|
+
* @returns {Array<CodecFrame|OggPage>} CodecFrames
|
|
2276
|
+
*/
|
|
2277
|
+
parseAll(fileData) {
|
|
2278
|
+
return [...this.parseChunk(fileData), ...this.flush()];
|
|
2279
|
+
}
|
|
2280
|
+
/**
|
|
2281
|
+
* @private
|
|
2282
|
+
*/
|
|
2283
|
+
*_getGenerator() {
|
|
2284
|
+
if (this._inputMimeType.match(/aac/)) {
|
|
2285
|
+
this._parser = new AACParser(this, this._headerCache, this._onCodec);
|
|
2286
|
+
} else if (this._inputMimeType.match(/mpeg/)) {
|
|
2287
|
+
this._parser = new MPEGParser(this, this._headerCache, this._onCodec);
|
|
2288
|
+
} else if (this._inputMimeType.match(/flac/)) {
|
|
2289
|
+
this._parser = new FLACParser(this, this._headerCache, this._onCodec);
|
|
2290
|
+
} else if (this._inputMimeType.match(/ogg/)) {
|
|
2291
|
+
this._parser = new OggParser(this, this._headerCache, this._onCodec);
|
|
2292
|
+
} else {
|
|
2293
|
+
throw new Error(`Unsupported Codec ${mimeType}`);
|
|
2294
|
+
}
|
|
2295
|
+
this._frameNumber = 0;
|
|
2296
|
+
this._currentReadPosition = 0;
|
|
2297
|
+
this._totalBytesIn = 0;
|
|
2298
|
+
this._totalBytesOut = 0;
|
|
2299
|
+
this._totalSamples = 0;
|
|
2300
|
+
this._sampleRate = void 0;
|
|
2301
|
+
this._rawData = new Uint8Array(0);
|
|
2302
|
+
while (true) {
|
|
2303
|
+
const frame2 = yield* this._parser[parseFrame]();
|
|
2304
|
+
if (frame2) yield frame2;
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
/**
|
|
2308
|
+
* @protected
|
|
2309
|
+
* @param {number} minSize Minimum bytes to have present in buffer
|
|
2310
|
+
* @returns {Uint8Array} rawData
|
|
2311
|
+
*/
|
|
2312
|
+
*[readRawData](minSize = 0, readOffset = 0) {
|
|
2313
|
+
let rawData2;
|
|
2314
|
+
while (this._rawData[length] <= minSize + readOffset) {
|
|
2315
|
+
rawData2 = yield;
|
|
2316
|
+
if (this._flushing) return this._rawData[subarray](readOffset);
|
|
2317
|
+
if (rawData2) {
|
|
2318
|
+
this._totalBytesIn += rawData2[length];
|
|
2319
|
+
this._rawData = concatBuffers(this._rawData, rawData2);
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
return this._rawData[subarray](readOffset);
|
|
2323
|
+
}
|
|
2324
|
+
/**
|
|
2325
|
+
* @protected
|
|
2326
|
+
* @param {number} increment Bytes to increment codec data
|
|
2327
|
+
*/
|
|
2328
|
+
[incrementRawData](increment) {
|
|
2329
|
+
this._currentReadPosition += increment;
|
|
2330
|
+
this._rawData = this._rawData[subarray](increment);
|
|
2331
|
+
}
|
|
2332
|
+
/**
|
|
2333
|
+
* @protected
|
|
2334
|
+
*/
|
|
2335
|
+
[mapCodecFrameStats](frame2) {
|
|
2336
|
+
this._sampleRate = frame2[header][sampleRate];
|
|
2337
|
+
frame2[header][bitrate] = frame2[duration] > 0 ? Math.round(frame2[data][length] / frame2[duration]) * 8 : 0;
|
|
2338
|
+
frame2[frameNumber] = this._frameNumber++;
|
|
2339
|
+
frame2[totalBytesOut] = this._totalBytesOut;
|
|
2340
|
+
frame2[totalSamples] = this._totalSamples;
|
|
2341
|
+
frame2[totalDuration] = this._totalSamples / this._sampleRate * 1e3;
|
|
2342
|
+
frame2[crc32] = this._crc32(frame2[data]);
|
|
2343
|
+
this._headerCache[checkCodecUpdate](
|
|
2344
|
+
frame2[header][bitrate],
|
|
2345
|
+
frame2[totalDuration]
|
|
2346
|
+
);
|
|
2347
|
+
this._totalBytesOut += frame2[data][length];
|
|
2348
|
+
this._totalSamples += frame2[samples];
|
|
2349
|
+
}
|
|
2350
|
+
/**
|
|
2351
|
+
* @protected
|
|
2352
|
+
*/
|
|
2353
|
+
[mapFrameStats](frame2) {
|
|
2354
|
+
if (frame2[codecFrames]) {
|
|
2355
|
+
if (frame2[isLastPage]) {
|
|
2356
|
+
let absoluteGranulePositionSamples = frame2[samples];
|
|
2357
|
+
frame2[codecFrames].forEach((codecFrame) => {
|
|
2358
|
+
const untrimmedCodecSamples = codecFrame[samples];
|
|
2359
|
+
if (absoluteGranulePositionSamples < untrimmedCodecSamples) {
|
|
2360
|
+
codecFrame[samples] = absoluteGranulePositionSamples > 0 ? absoluteGranulePositionSamples : 0;
|
|
2361
|
+
codecFrame[duration] = codecFrame[samples] / codecFrame[header][sampleRate] * 1e3;
|
|
2362
|
+
}
|
|
2363
|
+
absoluteGranulePositionSamples -= untrimmedCodecSamples;
|
|
2364
|
+
this[mapCodecFrameStats](codecFrame);
|
|
2365
|
+
});
|
|
2366
|
+
} else {
|
|
2367
|
+
frame2[samples] = 0;
|
|
2368
|
+
frame2[codecFrames].forEach((codecFrame) => {
|
|
2369
|
+
frame2[samples] += codecFrame[samples];
|
|
2370
|
+
this[mapCodecFrameStats](codecFrame);
|
|
2371
|
+
});
|
|
2372
|
+
}
|
|
2373
|
+
frame2[duration] = frame2[samples] / this._sampleRate * 1e3 || 0;
|
|
2374
|
+
frame2[totalSamples] = this._totalSamples;
|
|
2375
|
+
frame2[totalDuration] = this._totalSamples / this._sampleRate * 1e3 || 0;
|
|
2376
|
+
frame2[totalBytesOut] = this._totalBytesOut;
|
|
2377
|
+
} else {
|
|
2378
|
+
this[mapCodecFrameStats](frame2);
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
/**
|
|
2382
|
+
* @private
|
|
2383
|
+
*/
|
|
2384
|
+
_log(logger, messages) {
|
|
2385
|
+
if (this._enableLogging) {
|
|
2386
|
+
const stats = [
|
|
2387
|
+
`${codec}: ${this[codec]}`,
|
|
2388
|
+
`inputMimeType: ${this._inputMimeType}`,
|
|
2389
|
+
`readPosition: ${this._currentReadPosition}`,
|
|
2390
|
+
`totalBytesIn: ${this._totalBytesIn}`,
|
|
2391
|
+
`${totalBytesOut}: ${this._totalBytesOut}`
|
|
2392
|
+
];
|
|
2393
|
+
const width = Math.max(...stats.map((s) => s[length]));
|
|
2394
|
+
messages.push(
|
|
2395
|
+
`--stats--${"-".repeat(width - 9)}`,
|
|
2396
|
+
...stats,
|
|
2397
|
+
"-".repeat(width)
|
|
2398
|
+
);
|
|
2399
|
+
logger(
|
|
2400
|
+
"codec-parser",
|
|
2401
|
+
messages.reduce((acc, message) => acc + "\n " + message, "")
|
|
2402
|
+
);
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
/**
|
|
2406
|
+
* @protected
|
|
2407
|
+
*/
|
|
2408
|
+
[logWarning](...messages) {
|
|
2409
|
+
this._log(console.warn, messages);
|
|
2410
|
+
}
|
|
2411
|
+
/**
|
|
2412
|
+
* @protected
|
|
2413
|
+
*/
|
|
2414
|
+
[logError2](...messages) {
|
|
2415
|
+
this._log(console.error, messages);
|
|
2416
|
+
}
|
|
2417
|
+
};
|
|
2418
|
+
|
|
2419
|
+
// ../../node_modules/codec-parser/index.js
|
|
2420
|
+
var codec_parser_default = CodecParser;
|
|
2421
|
+
var codecFrames2 = codecFrames;
|
|
2422
|
+
var data2 = data;
|
|
2423
|
+
var isLastPage2 = isLastPage;
|
|
2424
|
+
var samples2 = samples;
|
|
2425
|
+
var totalSamples2 = totalSamples;
|
|
2426
|
+
|
|
2427
|
+
// ../../node_modules/@wasm-audio-decoders/flac/src/EmscriptenWasm.js
|
|
2428
|
+
init_text_decoder();
|
|
2429
|
+
function EmscriptenWASM(WASMAudioDecoderCommon2) {
|
|
2430
|
+
var Module = Module;
|
|
2431
|
+
var out = (text) => console.log(text);
|
|
2432
|
+
var err = (text) => console.error(text);
|
|
2433
|
+
function ready() {
|
|
2434
|
+
}
|
|
2435
|
+
Module = {};
|
|
2436
|
+
function abort(what) {
|
|
2437
|
+
throw what;
|
|
2438
|
+
}
|
|
2439
|
+
var HEAP8, HEAP16, HEAP32, HEAPU8, HEAPU16, HEAPU32, HEAPF32, HEAPF64, HEAP64, HEAPU64, wasmMemory;
|
|
2440
|
+
function updateMemoryViews() {
|
|
2441
|
+
var b = wasmMemory.buffer;
|
|
2442
|
+
HEAP8 = new Int8Array(b);
|
|
2443
|
+
HEAP16 = new Int16Array(b);
|
|
2444
|
+
HEAPU8 = new Uint8Array(b);
|
|
2445
|
+
HEAPU16 = new Uint16Array(b);
|
|
2446
|
+
HEAP32 = new Int32Array(b);
|
|
2447
|
+
HEAPU32 = new Uint32Array(b);
|
|
2448
|
+
HEAPF32 = new Float32Array(b);
|
|
2449
|
+
HEAPF64 = new Float64Array(b);
|
|
2450
|
+
HEAP64 = new BigInt64Array(b);
|
|
2451
|
+
HEAPU64 = new BigUint64Array(b);
|
|
2452
|
+
}
|
|
2453
|
+
var base64Decode = (b64) => {
|
|
2454
|
+
var b1, b2, i2 = 0, j = 0, bLength = b64.length;
|
|
2455
|
+
var output = new Uint8Array((bLength * 3 >> 2) - (b64[bLength - 2] == "=") - (b64[bLength - 1] == "="));
|
|
2456
|
+
for (; i2 < bLength; i2 += 4, j += 3) {
|
|
2457
|
+
b1 = base64ReverseLookup[b64.charCodeAt(i2 + 1)];
|
|
2458
|
+
b2 = base64ReverseLookup[b64.charCodeAt(i2 + 2)];
|
|
2459
|
+
output[j] = base64ReverseLookup[b64.charCodeAt(i2)] << 2 | b1 >> 4;
|
|
2460
|
+
output[j + 1] = b1 << 4 | b2 >> 2;
|
|
2461
|
+
output[j + 2] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i2 + 3)];
|
|
2462
|
+
}
|
|
2463
|
+
return output;
|
|
2464
|
+
};
|
|
2465
|
+
var __abort_js = () => abort("");
|
|
2466
|
+
var __emscripten_runtime_keepalive_clear = () => {
|
|
2467
|
+
};
|
|
2468
|
+
var timers = {};
|
|
2469
|
+
var callUserCallback = (func) => func();
|
|
2470
|
+
var _emscripten_get_now = () => performance.now();
|
|
2471
|
+
var __setitimer_js = (which, timeout_ms) => {
|
|
2472
|
+
if (timers[which]) {
|
|
2473
|
+
clearTimeout(timers[which].id);
|
|
2474
|
+
delete timers[which];
|
|
2475
|
+
}
|
|
2476
|
+
if (!timeout_ms) return 0;
|
|
2477
|
+
var id = setTimeout(() => {
|
|
2478
|
+
delete timers[which];
|
|
2479
|
+
callUserCallback(() => __emscripten_timeout(which, _emscripten_get_now()));
|
|
2480
|
+
}, timeout_ms);
|
|
2481
|
+
timers[which] = {
|
|
2482
|
+
id,
|
|
2483
|
+
timeout_ms
|
|
2484
|
+
};
|
|
2485
|
+
return 0;
|
|
2486
|
+
};
|
|
2487
|
+
var _emscripten_resize_heap = (requestedSize) => {
|
|
2488
|
+
var oldSize = HEAPU8.length;
|
|
2489
|
+
requestedSize >>>= 0;
|
|
2490
|
+
return false;
|
|
2491
|
+
};
|
|
2492
|
+
var _fd_close = (fd) => 52;
|
|
2493
|
+
var _fd_read = (fd, iov, iovcnt, pnum) => 52;
|
|
2494
|
+
var INT53_MAX = 9007199254740992;
|
|
2495
|
+
var INT53_MIN = -9007199254740992;
|
|
2496
|
+
var bigintToI53Checked = (num) => num < INT53_MIN || num > INT53_MAX ? NaN : Number(num);
|
|
2497
|
+
function _fd_seek(fd, offset, whence, newOffset) {
|
|
2498
|
+
offset = bigintToI53Checked(offset);
|
|
2499
|
+
return 70;
|
|
2500
|
+
}
|
|
2501
|
+
var printCharBuffers = [null, [], []];
|
|
2502
|
+
var UTF8Decoder = new TextDecoder();
|
|
2503
|
+
var UTF8ArrayToString = (heapOrArray, idx = 0, maxBytesToRead = NaN) => {
|
|
2504
|
+
var endIdx = idx + maxBytesToRead;
|
|
2505
|
+
var endPtr = idx;
|
|
2506
|
+
while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;
|
|
2507
|
+
return UTF8Decoder.decode(heapOrArray.buffer ? heapOrArray.subarray(idx, endPtr) : new Uint8Array(heapOrArray.slice(idx, endPtr)));
|
|
2508
|
+
};
|
|
2509
|
+
var printChar = (stream2, curr) => {
|
|
2510
|
+
var buffer2 = printCharBuffers[stream2];
|
|
2511
|
+
if (curr === 0 || curr === 10) {
|
|
2512
|
+
(stream2 === 1 ? out : err)(UTF8ArrayToString(buffer2));
|
|
2513
|
+
buffer2.length = 0;
|
|
2514
|
+
} else {
|
|
2515
|
+
buffer2.push(curr);
|
|
2516
|
+
}
|
|
2517
|
+
};
|
|
2518
|
+
var _fd_write = (fd, iov, iovcnt, pnum) => {
|
|
2519
|
+
var num = 0;
|
|
2520
|
+
for (var i2 = 0; i2 < iovcnt; i2++) {
|
|
2521
|
+
var ptr = HEAPU32[iov >> 2];
|
|
2522
|
+
var len = HEAPU32[iov + 4 >> 2];
|
|
2523
|
+
iov += 8;
|
|
2524
|
+
for (var j = 0; j < len; j++) {
|
|
2525
|
+
printChar(fd, HEAPU8[ptr + j]);
|
|
2526
|
+
}
|
|
2527
|
+
num += len;
|
|
2528
|
+
}
|
|
2529
|
+
HEAPU32[pnum >> 2] = num;
|
|
2530
|
+
return 0;
|
|
2531
|
+
};
|
|
2532
|
+
var _proc_exit = (code) => {
|
|
2533
|
+
throw `exit(${code})`;
|
|
2534
|
+
};
|
|
2535
|
+
for (var base64ReverseLookup = new Uint8Array(123), i = 25; i >= 0; --i) {
|
|
2536
|
+
base64ReverseLookup[48 + i] = 52 + i;
|
|
2537
|
+
base64ReverseLookup[65 + i] = i;
|
|
2538
|
+
base64ReverseLookup[97 + i] = 26 + i;
|
|
2539
|
+
}
|
|
2540
|
+
base64ReverseLookup[43] = 62;
|
|
2541
|
+
base64ReverseLookup[47] = 63;
|
|
2542
|
+
var wasmImports = {
|
|
2543
|
+
/** @export */
|
|
2544
|
+
"c": __abort_js,
|
|
2545
|
+
/** @export */
|
|
2546
|
+
"b": __emscripten_runtime_keepalive_clear,
|
|
2547
|
+
/** @export */
|
|
2548
|
+
"d": __setitimer_js,
|
|
2549
|
+
/** @export */
|
|
2550
|
+
"e": _emscripten_resize_heap,
|
|
2551
|
+
/** @export */
|
|
2552
|
+
"g": _fd_close,
|
|
2553
|
+
/** @export */
|
|
2554
|
+
"i": _fd_read,
|
|
2555
|
+
/** @export */
|
|
2556
|
+
"f": _fd_seek,
|
|
2557
|
+
/** @export */
|
|
2558
|
+
"h": _fd_write,
|
|
2559
|
+
/** @export */
|
|
2560
|
+
"a": _proc_exit
|
|
2561
|
+
};
|
|
2562
|
+
function assignWasmExports(wasmExports) {
|
|
2563
|
+
_free = wasmExports["l"];
|
|
2564
|
+
_malloc = wasmExports["m"];
|
|
2565
|
+
_create_decoder = wasmExports["n"];
|
|
2566
|
+
_destroy_decoder = wasmExports["o"];
|
|
2567
|
+
_decode_frame = wasmExports["p"];
|
|
2568
|
+
__emscripten_timeout = wasmExports["r"];
|
|
2569
|
+
}
|
|
2570
|
+
var _free, _malloc, _create_decoder, _destroy_decoder, _decode_frame, __emscripten_timeout;
|
|
2571
|
+
function initRuntime(wasmExports) {
|
|
2572
|
+
wasmExports["k"]();
|
|
2573
|
+
}
|
|
2574
|
+
if (!EmscriptenWASM.wasm) Object.defineProperty(EmscriptenWASM, "wasm", { get: () => String.raw`dynEncode01561175c7ec¥fÓŬѣkÁ@2ºÙì:rÛyë½ÙR9ßVNdü~=
|
|
2575
|
+
xW±b\°Û¼¥õä= ãjð$k¾¥OøÃ3tÚÇA0$|"ïô´
|
|
2576
|
+
Îß|Ø~´¹Î)@±nné|
|
|
2577
|
+
=}¼¤ç,Ò·CÈzä^(ËÒ;È?¯¡Ô+ºÕÌ |mlýÒ*môƽBI[µçFã6L|x9ÂÇrustRI¼ë7Çzÿ¡ÄáÌ%=Mä$+N!.L÷«´ÕÒeäºÏo0|d@1»¼¼¼¼¼Láþ˱Ýúâ "ÞMxhxéP4qÅ
|
|
2578
|
+
.3/=MRóMÚ6Ræ©®w±î×ÃñÉۯ̡Í@nê!'mù Bu= 2ªâ\Ä1É:«R´êîö>¦k?§ÞCuw"µçQùä{)3/®^ê2ãÃPrç5®u8Ë<ÄaSêXÁ'¦ôE£äñ'¨ 9v0ãKa= ¬ª/_Ør%A$ÕÞlÎýsÛ;d³ÎÌ=}äyAÞÛvjÑeaÜ»ÒHù)&*¢ÊJ¦ôñ fÉ¢n¢ë{©èm%ÞÛ¶*3.rªîjäËç{&Ìqkéº'äyp9¸áÒÿ<ü¹·I\CpðI<EÈsçççdr_oÖ{5Ͳé«Î¤à]³m-¬'EY(×!2[Ä!¹Ð= »ZA ×ÛWY3ö í³Ùày!·§¶kð.y¨;ÖZ¾à<æLMÂäN±ºT0@´®¹{Í
|
|
2579
|
+
¹ 8ÑeÍ"lž;=M2T¬P6u:'m7~qT4öZuU ×÷½÷N/uHee&Hò5ñÕÆ´¹,eĬöR¬dàFR7bݸÁ÷u*"2þ6¡yBÝmTÊ:*=Mt½Ü<¥Yî#&"S¸4õÇe¸½ auX67ó3øbòEHøDúºØtP´im2Wk_¯j>e¹pr#bCQ o|G&9ró"ÛyLb¿C½ì3MØõFØ#TjüÅgæºèÆ5¨UõÍ¢G¹m¨4&LäóFzÖ¥ÛÄF¨Ðm"_¡C¬»ÇÀê3tç4¾[£"=M¿ÿ7Z)IOR4Ô;2.j3Ü{9¬$0ÁGøTyaímE¯L(Ïä®#k«a3>§º.ocOй þùDjotF.ÅRG7HÿifåSËÒ.9°@½1åe ©}&æ-kM,u@í-ó.*Pßi}Lq¢_°çëÓ±¹s¬ KÍÓZøó:vÕ^×ʲ[5Òò1»ç˽6ÐÜr;íEp?Ýbbb©ÊÂVñ:¬ÍÓÀÊ!{ä¢T«ÁS]·dßÑ*zQtLG^i9g9׳½ÞD*7>.¹0y9ÌnpÄ®ÎEIÿ|'ºA=}äÔ¯8DLµøA<'@zèß²ndj¯È»Âu³7EÄʰ®B0"èÁðäôA©©-i1J''øyJVÿÉ&æÀp()xBØzäs%¿L
|
|
2580
|
+
î)øqÔÀÉã*Áú°hEJk©wáå2ݼE¿'+x)X6óÞ«ö=MmYì=}ºIÂ=Mgìb$öÇìbàÉ Ó9ûPÁ÷¾ÒÃëH®Õ?Ý5×Ã3ñ¨ä¢¯=M¡À?ì(-cͱä1±/¸#áuQOíÉò1MÐÇ cõRRÙõA ¸/nfÏÄÆ2F
UÖ·MGÈ<À= 267SõÑJÝbªV²â1¡ê.ûv(²2|w}ðWztGBÛhzh{ç*®5T7Á´éª &æÆïeÕÏ´ÜòÆN.;eϰضdÖ«2á~*úì9ò*Od¤<±
«cë#GÅɹx·Øq4MÞ±9¾zi'Î4I´M»èà¼NRÔ2³¨ÖÊvD³B×/|.=MõG³3Á&ÔF ý¡8WQåÏ5_pì¿Yöa1äÎI÷ ìQA@)E; e2ëBAôPAµIî$*ÖìÌë¸òÒsëÔÔÛáÃिÔ:Ñ
Ø}%2|@òøDîÓT½5Nt=MkKÙm¼½WÑpJ"kÑ[ÁþŵÔ/Ak*¹ÍDgîŦRôÔP'ZkªºT4I?ªc}´
éSOíOÿpA÷>ÁmÝLoLüÓS;M¡PT-MÀ&öÌüûC)¤ÕR:´ïìã)§*õÒ;y¥ÀÃC×p°Y:å2©kwÜåÑ/ñ®
-Ï5F9ÅmvÓ´½_¼yîÖåtS£4^MÖ0GßZ,ëÚYMûÇTø½UH÷ZòóÖÑ$-uMd©ÆlwIîÌbMî)eÔ®.ØMìµÕQ£òÁYÅÌXE*».¬½9SH¯ÅRîññ]´ÍXE:ô ªôcM,%´Ð1Ê¡É
|
|
2581
|
+
Ý1ºDòVÓPtQL\*ãÕLIÝT0xülÂËvôx&T6Ñ7«³¾CÞ@ëõRb#\¿V4é%²Hªd@Â#,ø=} !´RÒtåCû¤¶]lix*ÒÑC;a«µÙP\JãÔQ8
|
|
2582
|
+
\&EÒ;³ý±+ÖtÕHA"j|¬$Ã)î
Ô)Í.pÙ_&MT@¬¦sp1%8³1Ö_1éìKIµÒ«scno=}æ-ÏýáR2=}=}ÑrODR<w¯Ùa¨|È= ®é4I?¥Î¨¾~ÆMÁ½0=MF uÇûà*$¨= ¤I)òQ
5xb]I½Âxy}}3òéÈa'ʽÇ7h/óç$,ÏòëÄé3àq¿Ü3Ø|÷¬oÔ8¦ÐtÞîÀðâÊ{á¬ÒTg¼èÅùø]½OÌ6ä÷ë·/åi¼µ}"×óýËïÄüéýé??úÅ(Êó¢óÑó¤ØüéðÔ+_ fBo§\wúw£{"ß|"nwò
|
|
2583
|
+
Úrvl¥ÙÐÀ·à6Èoû=M%Gùl¦*4A ÜeS§ø;Wßd¥¨Ý}/b¥7T\c¥¾éÂÜ}7FZc¥¾i®ÎææÞsxyw= ËÞ£lw-Òü¦®ä¤·¯â)ýL%L=Még1¢åWõOWaErhS¬CûH
|
|
2584
|
+
¹ÌvÎÐæ:UÀ,þ³ÛóªkԤ̮أ%Õ
|
|
2585
|
+
32>|Jìáþóñz³êïô8ö¤÷ >eãnâ n¼ëÚú,³ýv#79µútWçl]ħ{p¨¿¿6쪰<Ò¡ûñc2#ª+3 û1c2CªÆ]ªPS×QÓLÃH²KtÜ¥Æ×%ý.x¾bºá¤6vþ6IÊ:ÈHüÃ.=}í-tUPVyEÈÈOæExÒ/C1n/=MÌJôr§L^@¤¾³éE49²ÐG½Gé§ÉvpËÐl<îÆb-¾2¯Ilp,7BÅ;ÈÐÐoèmf¢@(@ìÍ
|
|
2586
|
+
b|Ô5À=Mï÷w»B®Ô/ÇT ËÌõ
ïÇÀôE¸õ= ©zL)BÕú#üټ릦¢EÚsÈ
\tÙà=}8JD´Nîee¦gCYù9É?ÌëË-ïµ®9£÷ε=Mû[ù[õüßS¸ª ÔÎÔ!Á¬µ×@Ó#@ÊY+M´ ÐE\ÿ1wónDU!Á
|
|
2587
|
+
&×Za×°ÙèÅêRlûÊi_2 _A´[-ÃP;S_,ø)äJúÝ=MårJºêª2ýô_Sª<GÎýînb Ô°LØî^=MÜg{cD²SÔD+%Ñ@=}y¼@õ.öÄÏøÄ@°#IIðTA}ÆjòYäæXäõÖÏ<âµÛá#ñJ¼2ûº¹h:BîΣßð)îÜrb=}ú¡ñ(= àïîßÖòæyè.wh
|
|
2588
|
+
ÆB·ü{øÝ+ô>íf¤C<ü3
|
|
2589
|
+
©ýîÌ8j)¤ò¸0<j),ýî4ø³XLÌNÉ4ï@³³f5Í*aòßaÑ¿âW#»:.ÈDk½~FdRjiWÁ!W»@»ÞÅsËIÕ9*Îü²ê0Hü½Å²ÎÐ:²Ê!ÔñaôVóܲb»ò«Ð UJXËTu0Uen¿oÙ¸ÚU ÷êÉÿos¯Ë¬©äm·QW ®$ÑTjEX5>ãûPÆþóAQ?Ù@@öeDGL îäýУ58©üè·½Þ;ÎÕ!cÁb.^pj{ñ¸Ã¿B,·¨C³ýSüJ9¡<>[¥Grä@á$©Ø
|
|
2590
|
+
!É5ð¥4¡-³(Q´fJh
|
|
2591
|
+
覣
|
|
2592
|
+
£a¬ÅCJAq,ýÐq:öÛKwOd±'8©TMÁñ!£Ö´|B¢öûx5"¬è¤êj×ºØ y®}ða;ÄzEX»z «º(w¹Óúù±Å¶Áм|sAâļ¢ì|Ñcoé3"îB»¢ìB¿±À¡ÔåÂ_¹ùõUÿ殼<Úh4Ö«W¼\"ñ:f9æFV;µßAä>þàíâeê
±ñ£mͯW>KIF8ØÊ8Lv7¥B³º%MTr5ek(OTÃòU¡D¥¾DWÕ!è=}$²MAØî@H!:4§¨Bq¯Q ÐÞa4ÇïUí>Û©oYÖ2ÇÀµ_ l-CíCÁtýAPçdÈ_]äCù
|
|
2593
|
+
pöF6PêÓ
|
|
2594
|
+
ÁÎÜUÃTÖSÎóhæóήõ4d%a°1ËÅ@Ã$pøE7æ³T+h=MÆsaèlåBÍË©¾·yÇhÝÄS £ÚÊ"tÚeu,¾Ã¦ //üüBT°\ù UhÍ6OEy/ÓÁ]0'C%«³ÚlÄòqËåþwe6MMK«xpOß+ÅNÕt
ïÕ÷b¹Èÿ«~ÂïѼͻÈÏ;ðz"QÏÅ=}ýwª=}´ÐP=M¾½«1²ð:*)ÕH¼\¡Ãn¤8çCÃÞ÷×ÈæInCÝtÐ8>_dòPBó U¼»r0b»ÐhÕû³UþIoU/sBõÜ·:J¹ñ\t!N'û×cçø=Mà8aãjvX=}á©7ù~«Æj˾Jf¸ÞA¼gM÷ìkÀÃPf¹7DÓ&Q¦¯¾õ÷Ó~
|
|
2595
|
+
=M&4¥Q[0s&Ä[aba¢».¤AÊV7Â9Ñ:Û%»m°! ½¶o×Äø½cBÃ6¶YM&ªÌéF7ø,ïÚ_¯hzéFÈ5ýÁéWìú1êÃ-ÒÙ»õÊo<9RM¼mßuu]UÈr>g7J9¦£J&²HktÆÙø_~tèd+íkBK
GÑfR;9µG
|
|
2596
|
+
Z¥vøJ#ºRºÝ«?9$´ÿF´
µ±ËèöjØÈ|~= ZÊ\W4 {Å{xÌ)j¬^)Ã7Á6du,5µ-05f¿ýبÐòJ=M^ex?ÅgSøãOLáàe·MTT\P1QbãT¬¾Å÷×ôÎ×Y0+LN
|
|
2597
|
+
£ëåë%15X¿Yq&ª,LM$LÍ|w¡ìÚ¼è¹5³T¡Õù=MÕAEaÌÎÝø+aüóMëg#a'ÀhþfC54Üx×l·q@ºÚp>Ö.Tf°vuÜ'¸á\±Fï}5?³¯-0.KHÁ@ ̶\¹TY<¥
|
|
2598
|
+
ò!Nkd\X·,tƯ ÛáÙ̧cÁu~Äá³"âJ!éxcöh ð
GõüµGØ«(ß"¯<ì¢Ø5JI×4\¬æÃ¶qpÒ»y½ZRùÞVúý¼{¦E}¸f7/>ñÅã@ð¿<æË~è;{à#0iû7¢'Ühl ~~C=}¿Åý9%)ÂýKZÝâßÊòÈù²læB2ol汿ųèJHÔl&4\dÆÅYE [ïlUî&[= éùm¿·×8
|
|
2599
|
+
[z&|,X\Ûk°A¥evðý;èÒ(XÁ7§óïAµYÀ/Ë+ÕLM2Ñ$ÓɵU¿Q¡ýæYJ¹Ü¦PõéüUÕÚXXXXXȵþï?¹fÓyª_&ÀÖþ§Zjb{× ½*©Þh6Vâ»Öo^]£áAM±QBÍDÓM{é uÑL/5Á--´Qº>@¹z¶ðç}üòÍ,j_ø}NÂ|= ô )3 kçÝ{þ}l³o®òk=}ªeVÀ°¹ñØo÷t©, ¬c¬ °º¼Ù w_Ãp*¼dظ»ÛÁQö£²ê¡*%k7Ú4XÐaÎWÓc¯[öøf .8û'àZ¨WqvC±;Jìä1Ù%êÒE'f&³5ÿøs¨Ý±4éäfÀÂ׫(h®Y¶#%X+ºþ¤Èº!ùð,Eq+nù0]c÷
VÓG Öôþ®Û´Ç³#A&}ÏU÷5Ie=Mfs¢¥Kk(¥[%)NDí>IS¨ùmlÞoîÛôúÝÀqô¿l½±ÃÙÚÖÃoovþJ£òªá©Î¥-%+E>"Ð~fà%* £CóLK&/8w£Û &*$/¸©á ©K/øtèé½ômîÇ(cþ=}LX9
|
|
2600
|
+
ø÷I¦~&[þd#|Òv\ò¤ê#eGݳT8ÐIn(ÊÓkÏl¾ÇÕ\´ÓÃF¤uÇõÚMôÁûp¥KYal×s1Þqþ\ù$aÜgѨ782þé'W 8X UCÞ\ÛZäåØ'j@ºÎ2·)Eâz¡´Êvì;_]^ÜWn=Mâ"Üi·roÒö#qxçfï¹îßxÓMÚâ½Ù5
g¬zÝ-@¦cTóüÖSK!¶[ÓÉG² ´ÓMgH¿Q@o#Ë´û,Þ©Uù¤¢ÒAâcǼpÙ®emõW1ûbîÇ8\ a²îiFp!I}ÕTÕI%SÕÁ5QÅRCIÕGÑUT
Pë LËbT<ï{@d4¼ÊÆÜ'%A§´QEm¾ÖA¬µDÜîé¶}êú´òÄGÆrPfeÜAvØ5?Ûj^]*íÎpãÝ2nù
|
|
2601
|
+
ãçâ«7;S©ÞÐ1ïH&t½Àa[Ò-Ðÿ?ß7>+;é¶T²rÁç´ä=MsMÆêÌ~}[cÀÐ÷½®Åû¡laj>£xüg§nEÒl!4xwígv·P.'Oæ)ÊØ|©NvaJF_XÁ¿hàùËã´CéUSrÖÝQl7éi,Ô,»¼é9ëñÔ*W/P/¨=
|
|
2602
|
+
4S¿^¬2Ò
|
|
2603
|
+
w®õOÒú6â%ìÀ³îj¦óOÊ
V}#¶Ó3ËÅ=M ÙiÄ×
$ö Ù*ç9xçJÁ¥
{еhC@¨õÜ"kè~In{ 躶Fñ ÿåÜ(ïdÞå6Ër[»Æ~oýG
|
|
2604
|
+
d_CTþèu|«¡[u+]¦Öì!õݼ*Ù
|
|
2605
|
+
ë6GÁoôÀ[ôô|zK\7AûOUoc¶-p0*ÆÃâõ¯ôÓÆßoV!¿BapÅæúÂQäZXø¢H\"æ»Úû,j¬ @ÍÁ
Å@)eN|/4¹hp¸G#µí¼ðD¼?VKwÑDür\y¬ºëoâHn
Y¬V}bËJ÷>=}á£R^£¦«ú¡Ü%ÛÐù Z¾±u'Ô¾A³«º=}t¬ß³¾þøØx0®Òô= ;ÄÐz<·pBëãp$öæÔbk!uÄy¬¶ä±®ÆzMo¿ÜcÍD*¹· Cý>äpºZZ;ED¡u£æøq§Jÿ*ÏúÜ=}»,þdëX~pú}¹¶GiájÛ= ìb1·^t/ä÷ß;go¼Ö¢'°ý}ÉÎÇ#[MV2èëvçàiÄo0ûjÉ~,]@ª®Q:oô2C|ÁKýÏlî̯
|
|
2606
|
+
ÈW¢[\çþæ {NТÃíz°ê¾>!·2¢+"á[R« ²j©la±¡¹lÓÕaÍ&FáUÌ9SÇ2ëµÑgm÷r²×Nê°-aRùü_LVèãù!29+å)>
|
|
2607
|
+
pÊCÓ>Hiá¼íP"ø@aÕ~Àvu¤7):Á@gâ³Aû$9Qbòç9T
?[·xvÑüv°tæ@4A~åxE÷Z148aÉi²Z1e p+VåEÅEAFãYMû= ,èíhÆØ y
|
|
2608
|
+
©àEN¡~Ô_lÆ~T4ð= ò¦õ^Þ¢ÊQ¾óûbvrÌ3맪=MÝÝóÑZ_ëd>×<
OU#ÅpÞ"õ1¼Ö'¶Jx¶^wEPß¾´
 kU?^©ÏDªLÉsnù¬qÓÛjÒªa·ÙöʵV§û¯eѬ¸dºò°d½I[¦vD²òüp×F¦?´ 4@.bÞRÐ.+M[\= CÕ¾)Ví8sroÒÔFÀ(»±¢ä¡!ñÀGjt_Ã¥¼û¢QÐâuÒ¸ô0Öû´¨<¼±(Å.Þ¦Á+#«õ1Ú»]ýrê)üê±»~åjMNrKEÉå]³ì
öÈÊ8{æ¦îF~7=}oVOåâÓ:ÆTK=M%MÉKm%f6a=}·2+VAÑY¹^¤¶7OfÒx)
ãj1%aBHeHßøJùýa¬}À§ÅO®=}!à.¢'g7
|
|
2609
|
+
ðQ¿ïaãôuô<ߤ×ÖuÙ¿¥hÝND Ü:¦\qUÀÁÑO8²795kÚUÙ¢HvÎëµnOlÕZÁ¤<F)KÜÄ'ë"n³Õ|!$
|
|
2610
|
+
Àá±þÂÈ',zI}:}:íI©\!$Ú¦Ægd«ÒMQ;ËÆOHò;QÑØoMj<HwnÓÖ²èål¤_sëøYïWG@øÞKe˾932ÅæØÕº=MÊɶÊJ_UÚþM/ÑÆZÏeÿ
i*vÁ§K{¸ÙPª[ã\OìmÂpJùþ¿?ª1í\T-c?uaîwÒ+ùgfë_ÀOþFðj¤® RôºD¾<²úýݣÝdï죽£°uºÕ%VÏÒGÊ-ºz×0l>*?à4ÓÐ,<ÇkÕ¹²ÉNÍ
ÔÔ²Ò58mÄîr?å £ûP @bb^Y(±ålèÅo-hÅv=MöÅkÁR
|
|
2611
|
+
mXÂDmÃ.ǰdÙKU³ = LÑëø"Ôuqã>K䣴0°ÒîdË U ÖÎ4V»@]f¨i= "¨»Øk°Âß9B=}!î¤5ìgýë©Úz¥¦TáJC!êF;4
cÄ\VJYy'@úÿ°kÏ·ª{üj¦»
|
|
2612
|
+
GN$e:iª¬ÙÍõ´ÊܲÓaU¹Èßgº-vm5o<"DRÏ·*ëÀêhx÷= ÎÕóØê§ ®:ìÓ ÄF±ôZË>= íbC¦[É¿sDÜ-bÆÿ©n¯¸Óµùñb¥Öó¥Ìj®8%7Oüýb]Tb'
ë´Ê¡ÜbFÝ[µ"ÚÃÀrº:P¦Ùt §2ëáØÅ6Júì¦é¬
|
|
2613
|
+
h¾e¬îNd+;ÊÆÃsc7ÍâöKc"F¼îCq´}Á éi:(Ì@£ý¯>©'ªjaÔüϪxûtð×êÏ?yg¶[QñmI9ã)DÚP¹f=M|«§¬ªØ1$~á%1Ô¦aÎäÜQ¯ª¯X×>hº¿ZïeÖ ÇäÙ÷rAÙ!B:m8$;±{ÅO\%E%5ÕV+ ¾Ð°kLkN| iqÞ]&ce6Æ= y|Ù«c¶«yºè= ¬é4k?VkÈWÉ0Çdd¼Z[®ÓëWÚGå¯ @
|
|
2614
|
+
Φ ô:º5Î wãé2£¬+sɰF ñ !Mê¹kÁ®j/V¢§÷1¤ê+oY"&h&CkR'zØÔLyYÜ|p$Ç©J«{ò°6ÊúÝ¤ï¥ ü²âE ôNl]DG¾â[³"èGäuïöýøD±_º³òm«x5´/763X¼ñgèå÷tÁ»×¿»Ð¼-¯N§
OG±6ºy+þßc^iÄkY;vùGÔz»wõÁn»Ã¢ÌQ~~jÃÕÂ.øu´]Ðã ®ìGMm¡G@Ît¿¯u«ÊÈèòþ@¹ËdKÎd6õíì2®ü.$a"Ç>}?'JVfoL·,;×%Pj<'ñ7á´¨ïÇÂË
9Êo±îçл¨Ë¡jÕ¸ÎúF'²R¾G÷£K
|
|
2615
|
+
Nv0¡0:°K.¸¥.Úl¥Ùñÿ®^!¨d«pÆ}Ï+KÌè¸éIÈ¥¯¯WÄk
|
|
2616
|
+
´ÊUeFÝ=M÷=}@í^Í(4_ïìâgíäÛäæsy·äZeGØÚ?Ñy=}é¯W\ÁéïdÁ90ªæíeÀo¢õpÚoÁ?ÆF·DÌ0~tïtjLD2¼ÃuÝ@¾aÅîë³Ò
|
|
2617
|
+
C¾áHôÃZERvæðÁ< #&!àZ-Ê'©þéöBæÝ÷/ÕdH¨
4ØÖ|À¤§b¢*ÏFXº £$SýôªÿPÓ¤4é}$±ÂÅ4$Ü]Èô0l}Y_@7ÏßÏÈÖ6M¼à÷èiØX= Iï¼Ò£«¨ì0$°u¦ëì~³þnÓ¶©±ÄÁ¨1]ö¼]cCa
F9¹jé>ä~^X0û)cqJxÅãrDuÊÔ9J&²/¥Lç#ÖxvÒº[³¸
|
|
2618
|
+
(¬«k´ë¯ÝÜÆwêÃïâÅW6Ý©³ÖaþV+¸{.@íºXózHÁ6@{)íjÂHùSÀ
|
|
2619
|
+
'G¤Dîë-Ñté²N$ÎR̤oî4÷vëì~I¼_c@ÂÝk95
ø§PD MJ´ÎxÑQ©ÃfaÔv0buÞLQµT4eûÌúÃÁéq=}g°ì¿tïhÝ}ýºûBp}ËÚè·2ù&{íï_ÄÆi»íï
|
|
2620
|
+
ÝÿÙë,¹Hï:á= SÀ©Ñ1JdëÛ*}\½ùÌ_ÆkÞ:ÉÙÂ>dÇy
îÐ)dH4Åî2SY$ÑÛ{TÂðsThæÐäö«-5^îSÈE ^gOlö_¹/·´YûO
|
|
2621
|
+
û+Ä¿ë¨ðetêüu¼t~#dꬦð)6|ðô}óÇUæ0³Ô|Òjá/äå^ªóéýo¢øZ&ÌÇl,¹Fù
ä>í5voÓT[2'ÄtXè>õ°ÊJæG<ĬmoKijÍÑeº¦ïk;ûµÍªÁìÀ#ùº}OD.ÓaÓºC<ÿh¥³@c.6ÿõMSëà+Σ¦ÕÄÃÐÓ$ZÉréÈÜb}l ¼e5KHk]\IóaGAk£¼Í"û
|
|
2622
|
+
ûϳoõS ÃI1ÉUÁñRÌK¼)$H1%)ùøumÃó5T:{)¤äTû¿ùðU»0ÐY@ÔQ¥Æ0RLÅ;ç±æýb|E¸ù$ùî\µ1v¶kMè5ñ7¦0µ?m»Ìlõu³_ôÎ]_ªÊV;²·ÒiÃ]-gk0Úkø¯øw®yä°zbØèXD¯!jÍw¹cà.zj}ëïVØb8W@z»+ó5(= àaôdQnGhÍ*haóû{¤E°þépêà¡ozôNSÜku¬¯xäX¿åR|4.³@¸{£+Í*ï©k÷\Å b?¾!þ¨´>r$ðëfÙão>¼9ɾPx)e´hjETêÕ= O¬IE Tóê)RÍbÏIsHI·ï<q:íÖÏ719A!Húǵàzwo·ä¶?«vs×BÃ|3´ÛʳB>!·EK±µíü8¹d¯ÁÓ.
|
|
2623
|
+
¦xë¿ç ·çÐMLúDqæ't¦-C÷¬#É]¬§ÙÅÑB³R..6Øà]ÌÌjzÈQéâuò-nE@ªÍ@éà"D*ßz¹i.g®àiüªè_{Y¬t§¢Ò¦ø7bä{ôè¢ïï¬8󼼬ã´{®EÎæÀDH¨ïªù
|
|
2624
|
+
Ñ/MËlqIÜv¡d¡!«¨®C@X*YF_NÏ.³Üpú432~7j²7ßhÂüZõúçûÌEú6¤|[í×4w[S
|
|
2625
|
+
ªý£Cê~j®Mìj¢IW»¨ûsøÔ,óÝ#
|
|
2626
|
+
¿ÄÜ ÌgrϹ=M}Ìßù´G&ì6ïÊ! C°|ÓKcîëÿ¶^£¦ÌZT.ÀE_ò^ô72Ð\öV<1¡
|
|
2627
|
+
Ùc&£ØX#d#¾Ìbp/5Û{o5ô:¢¨Æ©sñ©ân= 5×rê_2ü)
«¤9ìkkÝuáuÙõXÀ,ËÜwòJ¢¨sÇ«þ«¯ó8þLúb°Ò±åjXYã2aλ6#'·4ËúFÔË0+ÙÐT!RF°OæçÝÞZ+ ( 7/öf÷{Ì2Ü®Ætuõè-÷é|"víÙ2v_#|ù3>.gXÏ:÷rÂøv?>¶IÄ3ªÍÔ®i"ÿ=}p2^0J4º(7QRмá]ÑeÄäSÊØ-ÉÛMpû9xªzõ22TécÇÿS*T¡ÈÄÉQÉÒÉ©Q©Qõ½ë%ÂÄUol44*TÌÀUaÈÔÉQIÒÁ©Q=M¨Qµºë%ÃÄUû
|
|
2628
|
+
£CEúLõ52TIÒÑ©Q=M©Qµ¼ë
ÄÄUl43*TÄÀUÊ.¦9ïß]¿vô.CbjºcQÅ_̽xYýT¤7©e®KzâeËdFj¢YãÛ,ãZ9üró#v÷"7ï?ë]ÿÍJ"Px"ç±è$pÙ¢Êÿ=Mè-xò±Ì{òp¡Ddú%¼W[w®}»##GT·é lÐ9ÜoL´ÉºÒcäªHW ª¬=MÁïÁX^rø!pJ#Úe±Üúo;¹æ9= hûé×@YÊ©[B|Æ£®TejëZ<jµ°° ýÖÛ£D;U5B¶,râ _¬ï0°å E9ùÐåNÖ= îoÇV¶Å¯½w-ô@ É©Zª²ïd'l
¢íLÁ÷âs¦oÅ×ô°/Ò lN_3¦%=M#ü1¶ÈH_aÛzkhÈUGMñ79µC÷ó÷¤
[XìÎÞyѬÑÕÌ¿»jU5±Ãêdª©&¨Ù:ó£òݤÝ%Ý.Ý¥ð/NfJÊa/5H¡ÊøÉÅD>ó(©÷èqª3l>æ5MA3h0
=M=}*¤¤Ã=}ªñ©Iòð;ªó¨,Æ
Ãÿ¦Ýy_õ|eªÙ= 6]k?.gûÖNG?È
|
|
2629
|
+
çpIjâB°
|
|
2630
|
+
âÒ {WGË&þvÈ|Ô¶lo8Ö
= ÆQyºrK+%>aô³àÄ·°Wý@Û«©ëþÐaf:hÇòê(»ÚfθËe NüýÔG«[DqÍrVËèE$cóDG*é¹sAºSY¹²J:(¶Û1zÃC¥4[óËÚ¯¡"¬ÎàNQLÊoòÜÅ|mÖÒ!%ÿõ¾vyfN¢,¼Õøñ1«
|
|
2631
|
+
=}9vo»ÞcÚ/oCM6ÿ>IãýõÒÇ2Cf
|
|
2632
|
+
®ôÄ~oyþp$\±(æ5j
|
|
2633
|
+
o¸#KVÖÙÃÛdjbIÀd¸ÖI¦àÝu²èÐ#Ñ>BUý/Ft4Ù= À,«&KÔH?IH)N"ÓeÞsçMñ?ï//ÅÍÅUÀÃK¢,$§8=MH00z/¯ò®ä[gu<ÖWY\"DXÈzQʰò§ZròÖrn^fvvWlîyÖ2÷VY\Èfs^^vvÖÖ_:Ô+KPK@?Ïs¡§Â+«)+³«)3 A3ÌÉã½ÖýÚ'Ù&]«Â2uYÂ×uì¡D]=Mä®|'B¦?´ÃÇRÜKøw¼{òâixÓØßñü¥®ß¥Põ&oíQÚãé^½íK_ñ}¹Ì»¡LÅ3:~Lo
}«.îþ²zÑÚÃ{WºçÀá°Ý½)ñf»û/ÍjÇC±³FÕÁRnzÇlæy?Lðl4×ß$elºvÑ{/Pý¡ÑÊYí5ýXmÂÅÅKÂ<4GÆÌôêêÄ(qx%È,éÛÃ@³âû!Àca?¡½Ñ÷Äï¡Ñîªk'ì¤.=}+_¿"ƺ±e¢ÀBùcCp¾Øp>ú¤:và÷¯¿ãÆ»5¹1¢lÂ1Ã0øcǤ«}¦{, é´ëwÓ¤,vÇp¶ìv9ÑÂý}£}̸ÆW0ÓTsq>ÂÝ_Í¿¸5ûN7í"F¡üPÍÖ.ÒQ¦W:RÈ·s~ùø÷WD4VbhwaûéÃx(c*ÞÜo§lá¸Ãйã쪢B'UR17?cÙMuÁÙ*=M]Îñ}eÒ¦Û"C47IS)ÏNJÄFàUbÒýO×[òu#=}=MÕ(¸º¬qA¯_B4ä»Äå\<Lú=M=M»ÄÉÂ
|
|
2634
|
+
]Üs.wô1eOsíËÄýH&s5
|
|
2635
|
+
*-óLÝNb2¢OyrÐxÅ6¹Áãëù¡Ã?>ϧ?ø)ê=}/(¥ÓäzLtëäÇ=}zòL,ñÞ:?srãçùûZÏ\ø? ü@b«óO+e"+,+eøi=M»K¹Ðüõ²ÊXmbõÔ³Sr:-S&= ®Sb9Wmqaê7u¼P¬Ã³Svï)_«GõL6@½ûuÚSï©4é¨m±.Ér+¯Ã´ûÒjG¸^µ¦ç8c<¨RÚàó|wiE*®WA? ±ªB G©GMª²Äf2É3|øë8sGkûÎåàñdÇË-ÓxLúNÒ´í8«ÄGpk¥{ÇëôAyxÄ;þN©äàýòȪ3Fömg%þN)áà½ó´ªÒù¯¶µ½
x?Jø8±¤
CJø8Ä ¢²!YÐgGò)!òâ
þÎ'?l«äo,\÷K;éJ®4«ü¥iøz7}¬ú= ÛÅéFSe,íKC¯GQ¥7~ÑäO²8{h©ÀRUêðû4½þaã¦%4|OKVÊô'è&¯öáâ¤i0[~õPCRϱDÆfIIÌð= ç³Åy¢0IÌÈÝþùÚÊçïÍ_:éÖ\bñ*|yß\îåcç>)½©.Ã-Å}ÄTê, ±'´kóÌûA^
|
|
2636
|
+
*6-H5HP>Qûí;à x¶<ãÌaÂìñ{]¯¸ Ý11½ 1'i0gñQû<5½èòe§=M;~eoÂ_¶A ÞyCªÃX}ÌXñr-÷ý«F©Ø)ZyFMZZUÆì6ÃØÉZUñ6Zm_Tç6hZí_Tß6©ZEgÒð6õ_twÎõö{Nà6]'¤« Þ+àÐA
gÜÔ»Óþòðò>jCGÒi½±.0¸qæLÌÏmk&D°_ϽYH[{u_=}êRÊ4«H©WOÃ{
]:=Mêjæ5ªH¸ÔIWOè=}XHA ôc½ê2cýëiæ¥Ïv:vÅÏvõ¦Hª4¦ÈvgÈóAD°å'.>7>ùk³[>= &k¦>&»mÖ~0[0«
|
|
2637
|
+
Z°0W0§]ððV£jÃCh=}±¸Ë!áÍ{jØT·\ñÇÏkX>9ÀÂØÜ7b]xà=}+jÚéæ4»«çÀp@«¦@+bª#Â+/ªOlOñº SÆò1ûøîÏôêáó§½§lá̧lÉ$öò¯b¯ø¬ò¯¢Û.£»¹/øºò0¶t©Þ{8º_O«¸'qºbZÙΦÝ8xÚ¯9¶Ý qù;'0ñ¹¤"]ÉÎS0Õ«»XÑ*9
$«õ1¥6d9Cæ Á·¢T4d´C*ì;&Öt´5}0a{ºßvµåQ"T ý&¢[
émK´ogÅ\8Ïï«u+¾"éYq*! >º5ÿí;'ð Ͳ {LÏÙÒ¯y&Ôþ'y"]z]<Íð¢¼íô
|
|
2638
|
+
"Sâ-èä§þ[è+Ûn*_N:ºìÞ/pÄÝáñü(,éðsZÜép
|
|
2639
|
+
§Xe®±îhøWÀc}w¹rÒçÉ»tÆâ¬ryäëÇäëÇäëÇäëÇäëÇäëÇäëÇäëÇäëÇäëÇäëÇäëÇäëÇäëÇäëÇäëgàÒGÀãsÁGÈ +е ήßT.gÑí´·ÖÌGèCC/\:a hæ%O?Ö:ýXH1 ´dÅÏvÿ:ÖRÜè=}YH¯{%[:-ëqæ%~qæ¥Ï|võ¨HÊÔ¯»4ªHº÷:ÿÖ÷:Ì´gÈsçÝ;KNðãðôhä´¸Jþøk³Wøþ[Àk³\>X&[àì¡à<Éiößø¡´õ6* Ádm¡$tu"(ügʦ÷1@nÚÿ´ÖÞ+Z´Ú+¡¦d+c\Pd"ªÓm-vAé ðy¾ó¯Ñßà¸FEçðEͦl1ÄöÜä®K{êú
øL²¯âOX ¸¹ÂåCp×t/ÿäX¡[Á ¿jâ @1þþ.GZJ¦é·ÏAîÁú»ª«Å×û,-ì'¨Á«+å×}È5¹µ+yöÏ£UDõTçPþhTT}Q¥Bê
KiÒ 8ϱhQÜ1íIÇÕ
,¹6o
|
|
2640
|
+
9&¢]ãÊy¸_ÜQ o^lxÊÝ4$
81:wãþ¶83oÃîË$&q¿"çQ@L´0ÀÐ\àrÔþªªbʾL¶ÒYxÄ&êBW"Iðêî8³ÓßYqViEg¼Hñű= pK=}2iu{ñ®¬i®8¬sÙìþh!DÀð\ÑÚgâ³Xõwâ6v$gcÝhÝæ6³Úgr»ØM7fÆNô|Îë6gØ-^°Øug^Tض£F\kØõfÒÜ6_¡FlÉUZÕØ56T_SiR|M¥F~M¥F±2ÅÉUG¤KÃÑÝÞÏÆ*tÏPÿ;¡áaIÉ ó¨±.=}TÖ©PÃûÛ¤?=Mêrûërû5ªÈ>êý:&SÜèýÊ«÷©PË{ݤ? dó(½êrû dó(°÷©°Ê èýJ4JäèYýJ{ݤ?èýÊvMênæåÏvÏv~Ïv±{ÍYHè½XHØèýYÈ»ëoæ ô= èW§HÄh#*mÝíM@Ú¹2LSÜ=M}|Ù1iéüû/uT?NC6ê¢hòè_e*hB%ümÜtêt~¹Ø,:*¢ØUD>¢Â/@çG¬å*¾NÃJÿ= µ×2y;UÆI]yðݳ+rwÿôéç9¼Úð{zRã¹lS¤ªNY¾/!6F°ÑÖ°©N>üÐ46tâ1nø¨scwܧEâZW [¸~Ð,7óA;ør7æcÙE²J
|
|
2641
|
+
½è[\¤+ÿªlà
|
|
2642
|
+
z,ö¿½ÿQò²=MËxG\¸Ô_èGjí}¯ÁãÑr¾Ñ"Ü£Ä,MA¹ÉèE.,,AÝ]X%*À>o
|
|
2643
|
+
ÍrCû êì-ÐLáphL=}Ý tæSA/CW/åb½µfÑÅ!ÔËRUeÃ÷öV©Ö;"
|
|
2644
|
+
ü¢.%êNäÖô= f¹EÔ¦§%®ëIñaÛèÊ9 l¶æbAaëçò;hÖùÍKPÏr=}yl%a&Ë-7©dµÆNí×é/öø
|
|
2645
|
+
·sÃËÖXð?9d-ÔäÔ´Tæ³õ»¤ÚØÂ"QmId
|
|
2646
|
+
Ú(!HºÊ;É·Â:ôç¬Õ¸+Ù<0ÁºFuiÚÓÿ½XÆÑ$9(SI'Øeqß^£FH¬´çàewîzøÝä¶òÍlÑu¬£e)ð¬"æ¢ÜaA«<|í"ý¸ÐwW>wìí$¿Nì~D|l¢Mg9ʨH7áÂzs!CA²ö=Mª4˰ïãÖÚXHLÓ7yʲã7«N0<ýözaî yGåxàè¯ôk C|Ðí5ý^úyÞ>û NäT/¼uÅjì¼#pôQMø}9ìÅ->7Z¿îP§µÆJd¸KKw¬5G(ÿÞëVÓ®=MhíÕÌ9°s?
BzìMɤªoòY¾9Íÿ¢%4 "ô¡¹(Tg=M¥g&«è=MÆ.s¤eÆÝ/±=}Ñ[]gPéÜ£í¢ª¿õwÃtÑbÐ,ü
u¡q%ø\Ëq æcéº{´à¿æüXý>öM[ÃάO{½aäÐvöjæaöÁås¨åñôêläñc±¦lªÂÈÔ7ÂÄɵäãúyÂyDwMvB¸§ìÛH¢ ÔØÂsdDôgNqþ×ta4ãkÏrÈv1?Äs90ËM<+Ú#3p7f´9³[':ìI>|G&\ÎU= ]Ó10&8Ù9ÃBGâ#´9,Ã)âáºëgOk\¦5LÞ9ÄjHzÉA4ªæhȰÝ\ý©9È¡o+2ÞOøpGm,yÁ ®YúãçÙ8ûäköt¬åºrR×)h§$¤m;BeJTx&µÑÙÞî h+v¦s¹ãNcþ&ÞóJ§¯É¦
|
|
2647
|
+
5y}NR&\#3äÇo³¡<1<]R¬©M$v¡¥ùØ<ܵø¢ >ZOr=}ÀÕâöÀ߯}xs:'ìbøîpxàMÿ® G¥ªBøÞM{eýª´ß'ÚnûÍOâjÛo~½;l¡GU.ÎØÒY׺箫kÔnµüF_Z·rã¹+ptAÙ¾Û~FzþÔJ+nÓ/¼{©ç°àîòàU@¦x¨¶èè-
|
|
2648
|
+
9^è*ß!
ò¾Ô7ê4èèµ®I1üðµ3w±ÈÔ7ª1j·Gé×R§ §BÃ-ç<m\HaðµÎöçZOÛyØ·ðµÔ·âFv*Ç/ìã%ÂØÂ!÷ðµ
¼Ô²°çñ/i&xÆOήö¡"2i¼_¥9ñEkùø£Q¡êÄ$ö PÆT˲ÚõÞUÂb=}5d7}øFõëiO¥683wRjT¦»ÉU|T¿^gÛU£ªÏÏU!ÎÅ^gÛUªòUjTÏ^gÛUêòU4u¥75ëÉÀòéõã zÓã³j)¡ÈÞT(j=Mþ~OêÕvkØ¥{Îusç6©#Ý5=}Ú:|kH®7z/Üë¼-´Ûþõf(o,DÈÔZûe§Ä}òþ<Y¤Äw8±WaX WÖ,6ÖÌÄ}¢ÂgÇõJÒÆkoãð ÛqPZ8ƲJºLj)ê7ç^ÕµU~¶þÈRáÆ¦!æ;½Q¯È-!%ìµB½Oû¹O½gÒõ;iÈ RºOKÔì5ìµÏì±w!EL Ò@®ÄÏì%ì5E½OÙ¹O¢®:4
|
|
2649
|
+
nÆkjUðx=MË7Ú}Áº±öûäs7$Å±è¢ ß
|
|
2650
|
+
ÚØý$XÚè4±þðÈ1[o¯Ãb´ÿj2Ë$Õ0R½Â¹g9¨´PòèXâÖªårÉ4e'Ü~éé¶RÙÖ÷3Òb×È$tÒÙÂÍî·¿!nüê6âv±?½â)b³h6ÛaW"çR6Z«\ëv4Ëá/Õ¸±®®pªÄTø_Õñ%¬9ÓIµRã
T m,øcYS:ì*V°= {yîå59ÙÏY°M8ùVAóìµWhòi1àú
|
|
2651
|
+
ðÛjmZA= ~[ÊVvè§ß"ó634áò'ìP⺪Sò£l§½B
ÆÂ´=Mô-.0²9ó"ð¹JÜúYëÕ°UÇÔеtbߥºâzdAÚ'ì!»
|
|
2652
|
+
jêW?ÉI|Ú~áý!nnáèÏ@u@^/é*C=}8¬+·µo¡ëûlíÕ+ªÛIÒ¨Ù÷ÞS
|
|
2653
|
+
o
ÊÚÊõptéq N¢·P1S01$Ãæï¼e
Ú§wA9-·*u,fåëº(nÌ8æÕî~âPñî6zÍ«¦e 1kM*{k¸g=},i~èø¶â7L/Ç qÄÂñ,Z8½Þ¥:Ý<ÚÀò
QZú%|0ÏßV¦Ô i_ú»qµ²ÝÇíÝ,l*àú= ÄC=}jµÚJzaö5ÎioûsOyµØxF'âJÊ]yÕyÞÚ¶B2À!LG¢Ðú¨ß&*Çúô¹âj-lKÿÅ(^Fsq5¢#~DçRÅpmí)¡qªz4»+ìfýhbÛ²;âú¥z
r¼iñwôZo¸ÝùM$!Iç¶ad-&vÏðÞ7úêËÖÎHiÏzRÐÚËA$#+ê<¹-t:DŽ]ozYwîóÐH¼Ëðñï笹¬X«£ÃTµ6uAHУð£ËêIuI%Õfաøõy5BÁiû!JÓôÝÈ¡9ÂtTæøÂ÷8=}Ó ¤é:Üz(±û÷Kb¡ô0ÐúÌ®»¹)ñÃOw%MêD¨]l<ÇÅRºêçGÞ°@<«øúνq¸ÊÕpÒ.üÝ6P¡\ÞßIG}Mp/qÇÑ¿v,§<)Ø&êËFªè:ì\Ìr_N\ë¸ñb+ýàzÍÝ´'R¡ÌGÙ|ÏÆ¶
|
|
2654
|
+
j¦sÏ0ìþjðW)°âmSúç'á8ºI.ÄhÐÌðÑ
ëÕÔÿu$Cl±Â{}(L ÛûøN%=} ôÆáU¹êb×Ü·2]îý±m¯ñÃ;cí8·8FdßùuÝMlÅFdto}ìÒ!S!H
|
|
2655
|
+
qiÎç0nw¡¥W¯XQ¯¸.vY½àPfÂðºêÐÔ»0ºMZ÷Çÿ0= £évGµ·F,Ý×·ñoG§v{H&xëh±ÚjEÔ¤à;66ÏÕ3óÍz;ϧ4ë¥;±Í$MàGêá&Ðëo!3WØ"^°Uµ´Ôù½
,b#%q´@;lxb_mŹQ¢óÐÊö´36ÁRp!
|
|
2656
|
+
òòÉu-
;Hq;§Ï©ÔVcWHT4\VdaZ¼¢·V'daÿx]d_rqhkzyÆÍÔÏÂÁ¸»¥ª©°³6=}D?RQHK.5,' #æíôïâáØÛþü÷
|
|
2657
|
+
$12+(UNGL9:C@=MûøåÞ×Üéêóð}vunglYZc= ¦¯´¡¢Å¾·¼ÉÊÓÐßäÝÖëèñòùúOTMF;8AB%30)*¿Ä½¶ËÈÑÒ§¬µ®£ otmf[Xabw|
~¤¨«²±ÌÇÎÕÀú¹x{\W^epsjiÿöýìçîõàãÚÙ4/&-"!<7>ZY¶vVVXÐ1Ã1Ã1¼Ã1Ã1ù13UÓ[whw\øÈ÷VHcè÷°÷Y0e\=M÷= À@÷÷Zà@þ¤6r¤AlDAü6i¦ÕF¬uFbå^!§Á]cñ«e = 9¨*yäùáI)©ß1Ó&Ñ,qâáSÞ%S'ÅN-WR%@q1I?yèBÈEDD´rÄäÄC¼¢Dª"
|
|
2658
|
+
$Ø$CÂâî¤BÎbEbÞÐÖdY= ØVÎÅ=MÃ1Ã1#0Ã1ÃóRÏÜlÝßn5( ûj(¬+ök·¼=MÄBÃÃV}0jä8ÆÁ¿Ã.ßCtq±³¿åCt51}6©I=Mv*T&)Ô1Ä=M³ÌÜmC
|
|
2659
|
+
s9h
|
|
2660
|
+
#äIÃg½Æ£¢³I´·[ì@ÇÛaÑÆ¦ÍAÒ-µFµcú\uô6ûÔ,ÍåÆYü,y*-Ì>Ã[Ü·
|
|
2661
|
+
¤+_nþ&a3qÈÁ§Öà°[û¦²©ÀpºÐãÝpWg$8X8XÆoåÞaÉèåÝÈFáVR}9nVÇWNàuúYEÞaÁ|VqqÌ·ÇWÜézâS[¶e/zQ®¤²Vì¶ÇWî¸nþYäVV^öÂDÊ}^wfhXwÚÚ^wfhXwïwwf^ÚÚfXwwf^ÚÚESÞMEMõõ{U]xWxòÈâf¨²Éábmx$oÀIß\>ø#m¥~ù a= ÈårÌ" ÞY8"h±Î9!dtÂäq¹î¹Z"ãkbà_Ynø%µ@ïdÀ6Þüp:ê,0ùÛéäÁ<ðDÐ÷åÄAûé!@8Øä0=}óHPöàúì5T9ÝðQüî=}´7ã Ñ;çàÐøÖÝDAJÖVlZV<|QÃ1Ã,ÃyÀ1Ã1ÃA3·Ü= ¦×ÄNbZs¶rÔØµbÒcvÒWL·k[}o2ס.VUÙa¡R]ÕØ[Fs«F]ÄÙ¦^6¾XF\ªÎ^¶Î[4gFo$FW2ݳm×W>÷§åpÅpµ§[ãõþ¼ª³¹öß= þ@þ)®S¾lø'Ã#Q¾'R(Òá4µð>ß<vqóñ+ßo",¡ñ,<<©¡ô¸p°ëî¸",ÌÓ(Ì
|
|
2662
|
+
sÌp,¾¸Õ¹!0E0¥0DRÁR=MDÕRÄ¡=Ml5åõ@Ä
TøÑÞ5Ë9àó¬2ÙdÓArÊÇ!$Äþ))B@åJ½ßqS8GUøUç~ß%PKÔU
Ç÷=M|2K0_)q{êiðÐÕÐûÚeíÚZJ.>w;;1>;-þ»ª¡?ý¢ã8þíÈú©,5ÿ9ðÇKî©©5ãeí*»@4ÎòDo}wËc\ úãx?ðÊÎNèú½ÙШ+öºFí
|
|
2663
|
+
2zuéEÜCºòoäè!£¨HÝ7¡H¹ÜjðïÕÛ[Iõo,#]<éOðE"7å¯wð4¥m
=MJÓP+»¡õîc(?ϼýó
|
|
2664
|
+
·02Êóïô(ô)£+J·°üSñ$Ù:lÊ¢rî\¹éàyNc |Eé_VO5ßsù^VLjQrV¥çë.¸*7Ôi*à7Ú%N§:9{·ooäÕßò£ÝÞ+¯;xÜÞ=Måx@7w¸H
Hùæ²ãâ¥Ç×=M:Ó yȽmÏ>tÆVfVVÚ4i0r,ü#¹Ãä)ó9^wÚf^wÚf^wÚwÚf^wÚf^wÚf^wR5M
Põ\|NðÃÉÄ:âÚ<p»ÓeûU¶ u@±îÛÍí6£}ÆWyÿ*ÿªÚÐ¬à ¥Óÿo»ùâ*
|
|
2665
|
+
H¬ñÀ£¿[ÆW¥e|°²!Ùk¾¾uC^@0pvVr^v2ßà¾á"ÚîäÎÞ HlQGjq%HAhm¸vüºo^Èdàå|.Zyèd4úÀ&aÓÜÓ_9·ô¾yRÚ°e-j§näCîì$Ì'D¯
¹ÅBçë5¬)/}ªÆ$iKó_àù Èp>Ùä¤ss:L]tFITUÐÃÅD=}RÚI4P»ÍÄaU2jt8ñËEá¡DciÍ7Nå÷ÆÂ÷9Ô
|
|
2666
|
+
¿àù*¿à¦@^±r,1lÀɱÃä.ºA.¿ å¾sýëû¿ûÃ?øË±Ãä.ºA.gñÂo¹÷M%I«Eµ |*p+XÙõërdûÄήǯ®æxànë°×å" rããÝmêQ!yçg.Þ2yðéÇ %ÏÂÓë ¬¢aòôú?ùúÃëúÌæÈ¨°Snðts¼Lî¨O*ÔeñÆ2Ð2æøE ¨=};?KãÊǰ6òGò»ð«ð0,¤tË,À}1fÇ$Ûõ(µ¼d*±AcïN(©ß©*N~C[Údôl(çJø)î_ó|çîî°Ù¥ !òã£}jªQiçbyMâ<ì¦J2è*M@Ðs«×11ì«P1 ¿»±u¯nÆ\
|
|
2667
|
+
[Lñ¦óu¿l¢|4*
!]Ä®ÅnìY¨Õ¥où³46øèv
v^¨aáóÛDD:¸¸ÇÀzIpÉZ³¬&9E_9측ÉY/ûmimÿB~=}+ÙPhÎî×"~VÂîKDü:¢¸¼ÀiôéÏßj!½kQñ !ç/.B2!ðO Ò%kÏ´Ó3¥"a²´:?Âaú[Ãs:2¬½Ìc ûÉ9Ã<l)rÔ¤ÕaÁnF¯Ó\Ù@ÿwVÀúX¨ãùØÀúû9b?:ÎíÀG¤X¸i½°ü¯g+Å\ïC¨=M«Í?#W½*ïÈÏÙ{eôu§?©ÓzgçíW²¦CÚª½«¨÷·s,¬¯ý³ãGWÞA£AOcla²jãü:|¸y»ë^ùä>·q
|
|
2668
|
+
Û3Â1ÃBV}=Mi~²ÌpÍBÍaç÷óB1¿ý·ÏË/3ÝEKD[MdàÝ¢ÝNÙì¨.kÇ·ûe~ù«¶»¢Â"í¯ 7à[¬D[@èË+~cÊùÙo×>¦c±ÃìÀb¡Û¾û0;dþÙÄÍÆ~^mÀ¸ñÃ#¨évYÖx¾QF´Å
.mAj¢³Òýû]Däʹ]:8W˵]3ùEDöÍÛó¦ækÃøj}õô%gÒV¸¥}ü}R©!yNÇ:LMÜÒAÐ'Gî\¹-ü-R!¡N:[L(ZÒ ÔxÜþeH>ySGtÓ}4Ýj·¡àÐÕ3·Óoøí¹@ÁͬÐñ8MÞ¿7 ¾ë¤É= Z·óGÐÔì²{Τð¥¥ò-²ZKÂÖ$´µx¼èÉï$%_´ëlIhVù¡5ßv<t¢ÓÓ$ÄÍÖ$½íQ[Ç«
0jÀÔ[ÔWTøG-~ÀSÛSíÚïR= IqD=MRÙw?¡HíiS3iS©ºéOgÜ7¬=}¹MÐ#U²2rä]êd3ÁSºO{¼Ç=}aM±Ðe1U2kä¹ ¤#ÕuT]˰UÃUmæ½T%SåU¯Æ¦PÿRé¨ù[åãÿ>_AnQ®8zõÇÎÍÆÊðn[*@vÓ|¨½ôÜ6ã$MÎð¼oÕ®s$Þ¤¨ÀÖ¬³4Ö
|
|
2669
|
+
îId35ó£ÉAõwݽÉê|£WÎi·÷=MCÞ±úõ¯:O6?ÒnÎö±5Ö±ÑNÓ½çÑÓÝAµ}à7+' ¦IF¥Fõã5U¶/áßè¹ÓéUÓFÁèzÝiµ-RfR}Re9e&±¡Bd8Å:µïEÉ59UhRjë;ÍÖw3wS:éjQÞÕÆ2]>MBUÔg4m3~Vh¢Ù©f^#FÊXwí(ÛÂÅfIúr±/¤0?óBtTö®Cëe~qWo4Üá+N8wÏådÍNý8y¿ÔübWuZRdÏã8Nqøk¾]ñ·l?²v@\ÜûO²è;ÉVW¨Tñ×óçí÷çÙÛ'å7ßGWgýw÷ §·ÇTWNgHwJ<6§@·BÇ$×ç÷,&'072GªW¨g®w´¢ §·Çº×¸ç¾÷ÄÒÐ'Æ7ÌG×ç÷
'{7yGWW]gcwaou§k·iÇÙéù )}9wIYY[iey_qs©m¹gɬY¦i°y²¤©¹É¼Ù¶éÀù ÔÎ)È9ÊIRYPiFyL:8©>¹DÉ"Ù éù *().94IïÙõéëùé ×Ý)ã9áIÿYiûyù=M©¹ÉþXhúxø¨¸ÈîØôèêøèÖÜ(â8àH#Ø!èø+)(/85HSXQhGxM;9¨?¸EȽطèÁøÃÕÏ(É8ËHX§h±x³¥¨¸ÈXXZhdx^pr¨l¸fÈØèø(|8vHªÅÅv÷ÄÏv¿ÄÆËÊv¸Ë¼¼»ÈÉVVVVTVTUTUU VVV¥æoVÚ::WÈîm]ì=}äeb»'ë¾¹Ýý×\yî!6îñg¸ î±ÞsÞYÞ½Y_l\2U×ÖÇ×_yÆÈhWs7<9X7\8k ¦\|2v²©£ïjúV` });
|
|
2670
|
+
var imports = {
|
|
2671
|
+
"a": wasmImports
|
|
2672
|
+
};
|
|
2673
|
+
this.setModule = (data3) => {
|
|
2674
|
+
WASMAudioDecoderCommon2.setModule(EmscriptenWASM, data3);
|
|
2675
|
+
};
|
|
2676
|
+
this.getModule = () => WASMAudioDecoderCommon2.getModule(EmscriptenWASM);
|
|
2677
|
+
this.instantiate = () => {
|
|
2678
|
+
this.getModule().then((wasm) => WebAssembly.instantiate(wasm, imports)).then((instance) => {
|
|
2679
|
+
const wasmExports = instance.exports;
|
|
2680
|
+
assignWasmExports(wasmExports);
|
|
2681
|
+
wasmMemory = wasmExports["j"];
|
|
2682
|
+
updateMemoryViews();
|
|
2683
|
+
initRuntime(wasmExports);
|
|
2684
|
+
ready();
|
|
2685
|
+
});
|
|
2686
|
+
this.ready = new Promise((resolve) => {
|
|
2687
|
+
ready = resolve;
|
|
2688
|
+
}).then(() => {
|
|
2689
|
+
this.HEAP = wasmMemory.buffer;
|
|
2690
|
+
this.malloc = _malloc;
|
|
2691
|
+
this.free = _free;
|
|
2692
|
+
this.create_decoder = _create_decoder;
|
|
2693
|
+
this.destroy_decoder = _destroy_decoder;
|
|
2694
|
+
this.decode_frame = _decode_frame;
|
|
2695
|
+
});
|
|
2696
|
+
return this;
|
|
2697
|
+
};
|
|
2698
|
+
}
|
|
2699
|
+
|
|
2700
|
+
// ../../node_modules/@wasm-audio-decoders/flac/src/FLACDecoder.js
|
|
2701
|
+
function Decoder() {
|
|
2702
|
+
this._init = () => {
|
|
2703
|
+
return new this._WASMAudioDecoderCommon().instantiate(this._EmscriptenWASM, this._module).then((common) => {
|
|
2704
|
+
this._common = common;
|
|
2705
|
+
this._inputBytes = 0;
|
|
2706
|
+
this._outputSamples = 0;
|
|
2707
|
+
this._frameNumber = 0;
|
|
2708
|
+
this._channels = this._common.allocateTypedArray(1, Uint32Array);
|
|
2709
|
+
this._sampleRate = this._common.allocateTypedArray(1, Uint32Array);
|
|
2710
|
+
this._bitsPerSample = this._common.allocateTypedArray(1, Uint32Array);
|
|
2711
|
+
this._samplesDecoded = this._common.allocateTypedArray(1, Uint32Array);
|
|
2712
|
+
this._outputBufferPtr = this._common.allocateTypedArray(1, Uint32Array);
|
|
2713
|
+
this._outputBufferLen = this._common.allocateTypedArray(1, Uint32Array);
|
|
2714
|
+
this._errorStringPtr = this._common.allocateTypedArray(1, Uint32Array);
|
|
2715
|
+
this._stateStringPtr = this._common.allocateTypedArray(1, Uint32Array);
|
|
2716
|
+
this._decoder = this._common.wasm.create_decoder(
|
|
2717
|
+
this._channels.ptr,
|
|
2718
|
+
this._sampleRate.ptr,
|
|
2719
|
+
this._bitsPerSample.ptr,
|
|
2720
|
+
this._samplesDecoded.ptr,
|
|
2721
|
+
this._outputBufferPtr.ptr,
|
|
2722
|
+
this._outputBufferLen.ptr,
|
|
2723
|
+
this._errorStringPtr.ptr,
|
|
2724
|
+
this._stateStringPtr.ptr
|
|
2725
|
+
);
|
|
2726
|
+
});
|
|
2727
|
+
};
|
|
2728
|
+
Object.defineProperty(this, "ready", {
|
|
2729
|
+
enumerable: true,
|
|
2730
|
+
get: () => this._ready
|
|
2731
|
+
});
|
|
2732
|
+
this.reset = () => {
|
|
2733
|
+
this.free();
|
|
2734
|
+
return this._init();
|
|
2735
|
+
};
|
|
2736
|
+
this.free = () => {
|
|
2737
|
+
this._common.wasm.destroy_decoder(this._decoder);
|
|
2738
|
+
this._common.free();
|
|
2739
|
+
};
|
|
2740
|
+
this._decode = (data3) => {
|
|
2741
|
+
if (!(data3 instanceof Uint8Array))
|
|
2742
|
+
throw Error(
|
|
2743
|
+
"Data to decode must be Uint8Array. Instead got " + typeof data3
|
|
2744
|
+
);
|
|
2745
|
+
const input = this._common.allocateTypedArray(
|
|
2746
|
+
data3.length,
|
|
2747
|
+
Uint8Array,
|
|
2748
|
+
false
|
|
2749
|
+
);
|
|
2750
|
+
input.buf.set(data3);
|
|
2751
|
+
this._common.wasm.decode_frame(this._decoder, input.ptr, input.len);
|
|
2752
|
+
let errorMessage = [], error;
|
|
2753
|
+
if (this._errorStringPtr.buf[0])
|
|
2754
|
+
errorMessage.push(
|
|
2755
|
+
"Error: " + this._common.codeToString(this._errorStringPtr.buf[0])
|
|
2756
|
+
);
|
|
2757
|
+
if (this._stateStringPtr.buf[0])
|
|
2758
|
+
errorMessage.push(
|
|
2759
|
+
"State: " + this._common.codeToString(this._stateStringPtr.buf[0])
|
|
2760
|
+
);
|
|
2761
|
+
if (errorMessage.length) {
|
|
2762
|
+
error = errorMessage.join("; ");
|
|
2763
|
+
console.error(
|
|
2764
|
+
"@wasm-audio-decoders/flac: \n " + errorMessage.join("\n ")
|
|
2765
|
+
);
|
|
2766
|
+
}
|
|
2767
|
+
const output = new Float32Array(
|
|
2768
|
+
this._common.wasm.HEAP,
|
|
2769
|
+
this._outputBufferPtr.buf[0],
|
|
2770
|
+
this._outputBufferLen.buf[0]
|
|
2771
|
+
);
|
|
2772
|
+
const decoded = {
|
|
2773
|
+
error,
|
|
2774
|
+
outputBuffer: this._common.getOutputChannels(
|
|
2775
|
+
output,
|
|
2776
|
+
this._channels.buf[0],
|
|
2777
|
+
this._samplesDecoded.buf[0]
|
|
2778
|
+
),
|
|
2779
|
+
samplesDecoded: this._samplesDecoded.buf[0]
|
|
2780
|
+
};
|
|
2781
|
+
this._common.wasm.free(this._outputBufferPtr.buf[0]);
|
|
2782
|
+
this._outputBufferLen.buf[0] = 0;
|
|
2783
|
+
this._samplesDecoded.buf[0] = 0;
|
|
2784
|
+
return decoded;
|
|
2785
|
+
};
|
|
2786
|
+
this.decodeFrames = (frames) => {
|
|
2787
|
+
let outputBuffers = [], errors = [], outputSamples = 0;
|
|
2788
|
+
for (let i = 0; i < frames.length; i++) {
|
|
2789
|
+
let offset = 0;
|
|
2790
|
+
const data3 = frames[i];
|
|
2791
|
+
while (offset < data3.length) {
|
|
2792
|
+
const chunk = data3.subarray(offset, offset + this._MAX_INPUT_SIZE);
|
|
2793
|
+
offset += chunk.length;
|
|
2794
|
+
const decoded = this._decode(chunk);
|
|
2795
|
+
outputBuffers.push(decoded.outputBuffer);
|
|
2796
|
+
outputSamples += decoded.samplesDecoded;
|
|
2797
|
+
if (decoded.error)
|
|
2798
|
+
this._common.addError(
|
|
2799
|
+
errors,
|
|
2800
|
+
decoded.error,
|
|
2801
|
+
data3.length,
|
|
2802
|
+
this._frameNumber,
|
|
2803
|
+
this._inputBytes,
|
|
2804
|
+
this._outputSamples
|
|
2805
|
+
);
|
|
2806
|
+
this._inputBytes += data3.length;
|
|
2807
|
+
this._outputSamples += decoded.samplesDecoded;
|
|
2808
|
+
}
|
|
2809
|
+
this._frameNumber++;
|
|
2810
|
+
}
|
|
2811
|
+
return this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(
|
|
2812
|
+
errors,
|
|
2813
|
+
outputBuffers,
|
|
2814
|
+
this._channels.buf[0],
|
|
2815
|
+
outputSamples,
|
|
2816
|
+
this._sampleRate.buf[0],
|
|
2817
|
+
this._bitsPerSample.buf[0]
|
|
2818
|
+
);
|
|
2819
|
+
};
|
|
2820
|
+
this._isWebWorker = Decoder.isWebWorker;
|
|
2821
|
+
this._WASMAudioDecoderCommon = Decoder.WASMAudioDecoderCommon || WASMAudioDecoderCommon;
|
|
2822
|
+
this._EmscriptenWASM = Decoder.EmscriptenWASM || EmscriptenWASM;
|
|
2823
|
+
this._module = Decoder.module;
|
|
2824
|
+
this._MAX_INPUT_SIZE = 65535 * 8;
|
|
2825
|
+
this._ready = this._init();
|
|
2826
|
+
return this;
|
|
2827
|
+
}
|
|
2828
|
+
var setDecoderClass = /* @__PURE__ */ Symbol();
|
|
2829
|
+
var determineDecodeMethod = /* @__PURE__ */ Symbol();
|
|
2830
|
+
var decodeFlac = /* @__PURE__ */ Symbol();
|
|
2831
|
+
var decodeOggFlac = /* @__PURE__ */ Symbol();
|
|
2832
|
+
var placeholderDecodeMethod = /* @__PURE__ */ Symbol();
|
|
2833
|
+
var decodeMethod = /* @__PURE__ */ Symbol();
|
|
2834
|
+
var init = /* @__PURE__ */ Symbol();
|
|
2835
|
+
var totalSamplesDecoded = /* @__PURE__ */ Symbol();
|
|
2836
|
+
var FLACDecoder = class {
|
|
2837
|
+
constructor() {
|
|
2838
|
+
this._onCodec = (codec2) => {
|
|
2839
|
+
if (codec2 !== "flac")
|
|
2840
|
+
throw new Error(
|
|
2841
|
+
"@wasm-audio-decoders/flac does not support this codec " + codec2
|
|
2842
|
+
);
|
|
2843
|
+
};
|
|
2844
|
+
new WASMAudioDecoderCommon();
|
|
2845
|
+
this[init]();
|
|
2846
|
+
this[setDecoderClass](Decoder);
|
|
2847
|
+
}
|
|
2848
|
+
[init]() {
|
|
2849
|
+
this[decodeMethod] = placeholderDecodeMethod;
|
|
2850
|
+
this[totalSamplesDecoded] = 0;
|
|
2851
|
+
this._codecParser = null;
|
|
2852
|
+
}
|
|
2853
|
+
[determineDecodeMethod](data3) {
|
|
2854
|
+
if (!this._codecParser && data3.length >= 4) {
|
|
2855
|
+
let codec2 = "audio/";
|
|
2856
|
+
if (data3[0] !== 79 || // O
|
|
2857
|
+
data3[1] !== 103 || // g
|
|
2858
|
+
data3[2] !== 103 || // g
|
|
2859
|
+
data3[3] !== 83) {
|
|
2860
|
+
codec2 += "flac";
|
|
2861
|
+
this[decodeMethod] = decodeFlac;
|
|
2862
|
+
} else {
|
|
2863
|
+
codec2 += "ogg";
|
|
2864
|
+
this[decodeMethod] = decodeOggFlac;
|
|
2865
|
+
}
|
|
2866
|
+
this._codecParser = new codec_parser_default(codec2, {
|
|
2867
|
+
onCodec: this._onCodec,
|
|
2868
|
+
enableFrameCRC32: false
|
|
2869
|
+
});
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
[setDecoderClass](decoderClass) {
|
|
2873
|
+
if (this._decoder) {
|
|
2874
|
+
const oldDecoder = this._decoder;
|
|
2875
|
+
oldDecoder.ready.then(() => oldDecoder.free());
|
|
2876
|
+
}
|
|
2877
|
+
this._decoder = new decoderClass();
|
|
2878
|
+
this._ready = this._decoder.ready;
|
|
2879
|
+
}
|
|
2880
|
+
[decodeFlac](flacFrames) {
|
|
2881
|
+
return this._decoder.decodeFrames(flacFrames.map((f) => f[data2] || f));
|
|
2882
|
+
}
|
|
2883
|
+
[decodeOggFlac](oggPages) {
|
|
2884
|
+
const frames = oggPages.map((page2) => page2[codecFrames2].map((f) => f[data2])).flat();
|
|
2885
|
+
const decoded = this._decoder.decodeFrames(frames);
|
|
2886
|
+
const oggPage = oggPages[oggPages.length - 1];
|
|
2887
|
+
if (oggPage && oggPage[isLastPage2]) {
|
|
2888
|
+
const samplesToTrim = this[totalSamplesDecoded] - oggPage[totalSamples2];
|
|
2889
|
+
if (samplesToTrim > 0) {
|
|
2890
|
+
for (let i = 0; i < decoded.channelData.length; i++)
|
|
2891
|
+
decoded.channelData[i] = decoded.channelData[i].subarray(
|
|
2892
|
+
0,
|
|
2893
|
+
decoded.samplesDecoded - samplesToTrim
|
|
2894
|
+
);
|
|
2895
|
+
decoded.samplesDecoded -= samplesToTrim;
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
this[totalSamplesDecoded] += decoded.samplesDecoded;
|
|
2899
|
+
return decoded;
|
|
2900
|
+
}
|
|
2901
|
+
[placeholderDecodeMethod]() {
|
|
2902
|
+
return WASMAudioDecoderCommon.getDecodedAudio([], [], 0, 0, 0);
|
|
2903
|
+
}
|
|
2904
|
+
get ready() {
|
|
2905
|
+
return this._ready;
|
|
2906
|
+
}
|
|
2907
|
+
async reset() {
|
|
2908
|
+
this[init]();
|
|
2909
|
+
return this._decoder.reset();
|
|
2910
|
+
}
|
|
2911
|
+
free() {
|
|
2912
|
+
this._decoder.free();
|
|
2913
|
+
}
|
|
2914
|
+
async decode(flacData) {
|
|
2915
|
+
if (this[decodeMethod] === placeholderDecodeMethod)
|
|
2916
|
+
this[determineDecodeMethod](flacData);
|
|
2917
|
+
return this[this[decodeMethod]]([
|
|
2918
|
+
...this._codecParser.parseChunk(flacData)
|
|
2919
|
+
]);
|
|
2920
|
+
}
|
|
2921
|
+
async flush() {
|
|
2922
|
+
const decoded = this[this[decodeMethod]]([...this._codecParser.flush()]);
|
|
2923
|
+
await this.reset();
|
|
2924
|
+
return decoded;
|
|
2925
|
+
}
|
|
2926
|
+
async decodeFile(flacData) {
|
|
2927
|
+
this[determineDecodeMethod](flacData);
|
|
2928
|
+
const decoded = this[this[decodeMethod]]([
|
|
2929
|
+
...this._codecParser.parseAll(flacData)
|
|
2930
|
+
]);
|
|
2931
|
+
await this.reset();
|
|
2932
|
+
return decoded;
|
|
2933
|
+
}
|
|
2934
|
+
async decodeFrames(flacFrames) {
|
|
2935
|
+
return this[decodeFlac](flacFrames);
|
|
2936
|
+
}
|
|
2937
|
+
};
|
|
2938
|
+
|
|
2939
|
+
// src/decode-flac.src.js
|
|
2940
|
+
var EMPTY = Object.freeze({ channelData: Object.freeze([]), sampleRate: 0 });
|
|
2941
|
+
async function decode(src) {
|
|
2942
|
+
let buf = src instanceof Uint8Array ? src : new Uint8Array(src);
|
|
2943
|
+
let dec = await decoder();
|
|
2944
|
+
try {
|
|
2945
|
+
let a = dec.decode(buf);
|
|
2946
|
+
let b = dec.flush();
|
|
2947
|
+
return hasAudio(b) ? merge(a, b) : a;
|
|
2948
|
+
} finally {
|
|
2949
|
+
dec.free();
|
|
2950
|
+
}
|
|
2951
|
+
}
|
|
2952
|
+
async function decoder() {
|
|
2953
|
+
let upstream = new FLACDecoder();
|
|
2954
|
+
await upstream.ready;
|
|
2955
|
+
let codec2 = upstream._decoder, wasm = codec2?._common?.wasm;
|
|
2956
|
+
let outputs = [
|
|
2957
|
+
codec2?._channels,
|
|
2958
|
+
codec2?._sampleRate,
|
|
2959
|
+
codec2?._bitsPerSample,
|
|
2960
|
+
codec2?._samplesDecoded,
|
|
2961
|
+
codec2?._outputBufferPtr,
|
|
2962
|
+
codec2?._outputBufferLen,
|
|
2963
|
+
codec2?._errorStringPtr,
|
|
2964
|
+
codec2?._stateStringPtr
|
|
2965
|
+
];
|
|
2966
|
+
if (typeof codec2?.decodeFrames !== "function" || typeof wasm?.create_decoder !== "function" || typeof wasm.destroy_decoder !== "function" || outputs.some((output) => !output?.buf || output.ptr == null)) {
|
|
2967
|
+
upstream.free();
|
|
2968
|
+
throw Error("Unsupported @wasm-audio-decoders/flac internals");
|
|
2969
|
+
}
|
|
2970
|
+
let parser = null, prefix = null, lookahead = null, ogg = false, total2 = 0, fresh = true;
|
|
2971
|
+
let pendingRaw = false, duplicateFrames = 0, ended = false, freed = false;
|
|
2972
|
+
let resetStream = () => {
|
|
2973
|
+
wasm.destroy_decoder(codec2._decoder);
|
|
2974
|
+
codec2._inputBytes = codec2._outputSamples = codec2._frameNumber = 0;
|
|
2975
|
+
for (let output of outputs) output.buf.fill(0);
|
|
2976
|
+
codec2._decoder = wasm.create_decoder(...outputs.map((output) => output.ptr));
|
|
2977
|
+
if (!codec2._decoder) throw Error("Could not reset FLAC decoder");
|
|
2978
|
+
parser = null;
|
|
2979
|
+
prefix = null;
|
|
2980
|
+
lookahead = null;
|
|
2981
|
+
ogg = false;
|
|
2982
|
+
total2 = 0;
|
|
2983
|
+
fresh = true;
|
|
2984
|
+
pendingRaw = false;
|
|
2985
|
+
duplicateFrames = 0;
|
|
2986
|
+
};
|
|
2987
|
+
let decodeItems = (items) => {
|
|
2988
|
+
if (duplicateFrames && !ogg) {
|
|
2989
|
+
let skip = Math.min(duplicateFrames, items.length);
|
|
2990
|
+
items = items.slice(skip);
|
|
2991
|
+
duplicateFrames -= skip;
|
|
2992
|
+
}
|
|
2993
|
+
if (!items.length) return null;
|
|
2994
|
+
if (!ogg) return codec2.decodeFrames(items.map((f) => f[data2] || f));
|
|
2995
|
+
let frames = items.flatMap((p) => p[codecFrames2].map((f) => f[data2]));
|
|
2996
|
+
let decoded = codec2.decodeFrames(frames);
|
|
2997
|
+
total2 += decoded.samplesDecoded;
|
|
2998
|
+
let page2 = items[items.length - 1];
|
|
2999
|
+
if (page2?.[isLastPage2]) {
|
|
3000
|
+
let trim = total2 - page2[totalSamples2];
|
|
3001
|
+
if (trim > 0) {
|
|
3002
|
+
let keep = Math.max(0, decoded.samplesDecoded - trim);
|
|
3003
|
+
for (let i = 0; i < decoded.channelData.length; i++)
|
|
3004
|
+
decoded.channelData[i] = decoded.channelData[i].subarray(0, keep);
|
|
3005
|
+
total2 -= decoded.samplesDecoded - keep;
|
|
3006
|
+
decoded.samplesDecoded = keep;
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
3009
|
+
return decoded;
|
|
3010
|
+
};
|
|
3011
|
+
upstream.decode = (chunk) => {
|
|
3012
|
+
if (freed) throw Error("Decoder already freed");
|
|
3013
|
+
if (ended) throw Error("Decoder already flushed");
|
|
3014
|
+
if (!chunk) return EMPTY;
|
|
3015
|
+
let buf = chunk instanceof Uint8Array ? chunk : new Uint8Array(chunk);
|
|
3016
|
+
if (!buf.length) return EMPTY;
|
|
3017
|
+
if (pendingRaw) {
|
|
3018
|
+
if (lookahead) buf = concatBytes(lookahead, buf);
|
|
3019
|
+
if (buf.length < 4) {
|
|
3020
|
+
lookahead = buf.slice();
|
|
3021
|
+
return EMPTY;
|
|
3022
|
+
}
|
|
3023
|
+
lookahead = null;
|
|
3024
|
+
if (isStreamStart(buf)) resetStream();
|
|
3025
|
+
else pendingRaw = false;
|
|
3026
|
+
}
|
|
3027
|
+
let wasFresh = fresh;
|
|
3028
|
+
fresh = false;
|
|
3029
|
+
if (!parser) {
|
|
3030
|
+
if (prefix) buf = concatBytes(prefix, buf);
|
|
3031
|
+
if (buf.length < 4) {
|
|
3032
|
+
prefix = buf.slice();
|
|
3033
|
+
return EMPTY;
|
|
3034
|
+
}
|
|
3035
|
+
prefix = null;
|
|
3036
|
+
ogg = buf[0] === 79 && buf[1] === 103 && buf[2] === 103 && buf[3] === 83;
|
|
3037
|
+
parser = createParser(ogg);
|
|
3038
|
+
}
|
|
3039
|
+
if (wasFresh) {
|
|
3040
|
+
if (ogg && isCompleteOggStream(buf)) {
|
|
3041
|
+
let r2 = decodeItems([...parser.parseAll(buf)]);
|
|
3042
|
+
resetStream();
|
|
3043
|
+
return hasAudio(r2) ? r2 : EMPTY;
|
|
3044
|
+
}
|
|
3045
|
+
if (!ogg) {
|
|
3046
|
+
let initial = parseInitialFlac(buf);
|
|
3047
|
+
if (initial) {
|
|
3048
|
+
let primed = 0;
|
|
3049
|
+
if (!initial.total) {
|
|
3050
|
+
for (let frame2 of parser.parseChunk(buf)) if (frame2) primed++;
|
|
3051
|
+
}
|
|
3052
|
+
let r2 = decodeItems(initial.frames);
|
|
3053
|
+
if (initial.total) resetStream();
|
|
3054
|
+
else {
|
|
3055
|
+
duplicateFrames = Math.max(0, initial.frames.length - primed);
|
|
3056
|
+
pendingRaw = true;
|
|
3057
|
+
}
|
|
3058
|
+
return hasAudio(r2) ? r2 : EMPTY;
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
let r = decodeItems([...parser.parseChunk(buf)]);
|
|
3063
|
+
return hasAudio(r) ? r : EMPTY;
|
|
3064
|
+
};
|
|
3065
|
+
upstream.flush = () => {
|
|
3066
|
+
if (freed || ended) return EMPTY;
|
|
3067
|
+
ended = true;
|
|
3068
|
+
if (!parser) {
|
|
3069
|
+
prefix = lookahead = null;
|
|
3070
|
+
return EMPTY;
|
|
3071
|
+
}
|
|
3072
|
+
try {
|
|
3073
|
+
let items = lookahead ? [...parser.parseChunk(lookahead), ...parser.flush()] : [...parser.flush()];
|
|
3074
|
+
lookahead = null;
|
|
3075
|
+
let r = decodeItems(items);
|
|
3076
|
+
return hasAudio(r) ? r : EMPTY;
|
|
3077
|
+
} finally {
|
|
3078
|
+
parser = null;
|
|
3079
|
+
prefix = lookahead = null;
|
|
3080
|
+
}
|
|
3081
|
+
};
|
|
3082
|
+
let free2 = upstream.free.bind(upstream);
|
|
3083
|
+
upstream.free = () => {
|
|
3084
|
+
if (freed) return;
|
|
3085
|
+
freed = true;
|
|
3086
|
+
parser = null;
|
|
3087
|
+
prefix = lookahead = null;
|
|
3088
|
+
free2();
|
|
3089
|
+
};
|
|
3090
|
+
return upstream;
|
|
3091
|
+
}
|
|
3092
|
+
function createParser(ogg) {
|
|
3093
|
+
return new codec_parser_default(ogg ? "audio/ogg" : "audio/flac", {
|
|
3094
|
+
onCodec: (codec2) => {
|
|
3095
|
+
if (codec2 !== "flac") throw Error("@audio/decode-flac does not support this codec " + codec2);
|
|
3096
|
+
},
|
|
3097
|
+
enableFrameCRC32: false
|
|
3098
|
+
});
|
|
3099
|
+
}
|
|
3100
|
+
function parseInitialFlac(buf) {
|
|
3101
|
+
let info = flacInfo(buf);
|
|
3102
|
+
if (!info) return null;
|
|
3103
|
+
try {
|
|
3104
|
+
let frames = [...createParser(false).parseAll(buf)];
|
|
3105
|
+
if (!frames.length) return null;
|
|
3106
|
+
let parsed = frames.reduce((total2, frame2) => total2 + (frame2[samples2] || 0), 0);
|
|
3107
|
+
return !info.total || parsed === info.total ? { frames, total: info.total } : null;
|
|
3108
|
+
} catch {
|
|
3109
|
+
return null;
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
function flacInfo(buf) {
|
|
3113
|
+
if (buf.length < 42 || buf[0] !== 102 || buf[1] !== 76 || buf[2] !== 97 || buf[3] !== 67 || (buf[4] & 127) !== 0 || (buf[5] << 16 | buf[6] << 8 | buf[7]) < 34)
|
|
3114
|
+
return null;
|
|
3115
|
+
let total2 = (buf[21] & 15) * 4294967296 + buf[22] * 16777216 + buf[23] * 65536 + buf[24] * 256 + buf[25];
|
|
3116
|
+
for (let offset = 4; offset + 4 <= buf.length; ) {
|
|
3117
|
+
let last = buf[offset] & 128;
|
|
3118
|
+
let length2 = buf[offset + 1] * 65536 + buf[offset + 2] * 256 + buf[offset + 3];
|
|
3119
|
+
offset += 4 + length2;
|
|
3120
|
+
if (offset > buf.length) return null;
|
|
3121
|
+
if (last) return { total: total2 };
|
|
3122
|
+
}
|
|
3123
|
+
return null;
|
|
3124
|
+
}
|
|
3125
|
+
function isStreamStart(buf) {
|
|
3126
|
+
return buf[0] === 102 && buf[1] === 76 && buf[2] === 97 && buf[3] === 67 || buf[0] === 79 && buf[1] === 103 && buf[2] === 103 && buf[3] === 83;
|
|
3127
|
+
}
|
|
3128
|
+
function isCompleteOggStream(buf) {
|
|
3129
|
+
let offset = 0, first = true;
|
|
3130
|
+
while (offset < buf.length) {
|
|
3131
|
+
if (offset + 27 > buf.length || buf[offset] !== 79 || buf[offset + 1] !== 103 || buf[offset + 2] !== 103 || buf[offset + 3] !== 83 || buf[offset + 4] !== 0)
|
|
3132
|
+
return false;
|
|
3133
|
+
let flags = buf[offset + 5], segments2 = buf[offset + 26];
|
|
3134
|
+
if (first && !(flags & 2)) return false;
|
|
3135
|
+
let body = offset + 27 + segments2;
|
|
3136
|
+
if (body > buf.length) return false;
|
|
3137
|
+
let end = body;
|
|
3138
|
+
for (let i = offset + 27; i < body; i++) end += buf[i];
|
|
3139
|
+
if (end > buf.length) return false;
|
|
3140
|
+
if (flags & 4) return end === buf.length;
|
|
3141
|
+
offset = end;
|
|
3142
|
+
first = false;
|
|
3143
|
+
}
|
|
3144
|
+
return false;
|
|
3145
|
+
}
|
|
3146
|
+
function hasAudio(result) {
|
|
3147
|
+
return !!result?.channelData?.[0]?.length;
|
|
3148
|
+
}
|
|
3149
|
+
function concatBytes(a, b) {
|
|
3150
|
+
let r = new Uint8Array(a.length + b.length);
|
|
3151
|
+
r.set(a);
|
|
3152
|
+
r.set(b, a.length);
|
|
3153
|
+
return r;
|
|
3154
|
+
}
|
|
3155
|
+
function merge(a, b) {
|
|
3156
|
+
if (!hasAudio(b)) return a;
|
|
3157
|
+
if (!hasAudio(a)) return b;
|
|
3158
|
+
return {
|
|
3159
|
+
channelData: a.channelData.map((ch, i) => {
|
|
3160
|
+
let bc = b.channelData[i] || b.channelData[0];
|
|
3161
|
+
let m = new Float32Array(ch.length + bc.length);
|
|
3162
|
+
m.set(ch);
|
|
3163
|
+
m.set(bc, ch.length);
|
|
3164
|
+
return m;
|
|
3165
|
+
}),
|
|
3166
|
+
sampleRate: a.sampleRate
|
|
3167
|
+
};
|
|
3168
|
+
}
|
|
3169
|
+
export {
|
|
3170
|
+
decoder,
|
|
3171
|
+
decode as default
|
|
3172
|
+
};
|