@openclaw/whatsapp 2026.9.6 → 2026.9.8
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/{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-Bg_fS2iF.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-rurG-kbr.mjs → channel.runtime-C94goLw9.mjs} +4 -4
- package/dist/.setup/{channel.setup-C8P5q8uD.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-By82ehLA.mjs → monitor-CGpV2VNN.mjs} +376 -504
- 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-pGqWOiFX.mjs → setup-finalize-DmPX4EaW.mjs} +32 -70
- package/dist/.setup/setup-plugin-api-vJlxKzca.mjs +3 -0
- package/dist/.setup/{setup-surface-B9CYwDPZ.mjs → setup-surface-43fj197P.mjs} +3 -3
- package/dist/.setup/{shared-DVgQ8kRG.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 +5 -12
- 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 +2 -2
- package/dist/login-qr-runtime.js +1 -1
- package/dist/runtime-api.js +9 -9
- 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 +1 -1
- package/node_modules/baileys/node_modules/file-type/readme.md +2 -0
- package/node_modules/baileys/node_modules/file-type/source/detectors/zip.js +9 -4
- 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-2wUapweU.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,33 @@
|
|
|
1
|
+
export interface AudioData {
|
|
2
|
+
channelData: Float32Array[];
|
|
3
|
+
sampleRate: number;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
interface WmaDecoder {
|
|
7
|
+
decode(data: Uint8Array | ArrayBuffer): AudioData;
|
|
8
|
+
flush(): AudioData;
|
|
9
|
+
free(): void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Decode WMA audio buffer to PCM samples */
|
|
13
|
+
export default function decode(src: ArrayBuffer | Uint8Array): Promise<AudioData>;
|
|
14
|
+
|
|
15
|
+
/** Create streaming decoder instance */
|
|
16
|
+
export function decoder(): Promise<WmaDecoder>;
|
|
17
|
+
|
|
18
|
+
/** Parse ASF data packet, extract compressed audio payloads */
|
|
19
|
+
export function parsePacket(pkt: Uint8Array, packetSize: number): Uint8Array[];
|
|
20
|
+
|
|
21
|
+
/** Parse ASF container, extract audio properties and raw packets */
|
|
22
|
+
export function demuxASF(buf: Uint8Array): {
|
|
23
|
+
channels: number;
|
|
24
|
+
sampleRate: number;
|
|
25
|
+
bitRate: number;
|
|
26
|
+
blockAlign: number;
|
|
27
|
+
bitsPerSample: number;
|
|
28
|
+
formatTag: number;
|
|
29
|
+
codecData: Uint8Array | null;
|
|
30
|
+
duration: number;
|
|
31
|
+
packetSize: number;
|
|
32
|
+
packets: Uint8Array[];
|
|
33
|
+
};
|
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WMA decoder — ASF demuxer (pure JS) + RockBox wmadec (WASM)
|
|
3
|
+
* Decodes WMA v1/v2 in ASF containers
|
|
4
|
+
*
|
|
5
|
+
* let { channelData, sampleRate } = await decode(wmabuf)
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import createWMA from './src/wma.wasm.js'
|
|
9
|
+
|
|
10
|
+
const EMPTY = Object.freeze({ channelData: [], sampleRate: 0 })
|
|
11
|
+
|
|
12
|
+
// ASF GUIDs (16 bytes each, little-endian)
|
|
13
|
+
const GUID = {
|
|
14
|
+
header: [0x30,0x26,0xb2,0x75,0x8e,0x66,0xcf,0x11,0xa6,0xd9,0x00,0xaa,0x00,0x62,0xce,0x6c],
|
|
15
|
+
fileProps: [0xa1,0xdc,0xab,0x8c,0x47,0xa9,0xcf,0x11,0x8e,0xe4,0x00,0xc0,0x0c,0x20,0x53,0x65],
|
|
16
|
+
streamProps: [0x91,0x07,0xdc,0xb7,0xb7,0xa9,0xcf,0x11,0x8e,0xe6,0x00,0xc0,0x0c,0x20,0x53,0x65],
|
|
17
|
+
audioMedia: [0x40,0x9e,0x69,0xf8,0x4d,0x5b,0xcf,0x11,0xa8,0xfd,0x00,0x80,0x5f,0x5c,0x44,0x2b],
|
|
18
|
+
data: [0x36,0x26,0xb2,0x75,0x8e,0x66,0xcf,0x11,0xa6,0xd9,0x00,0xaa,0x00,0x62,0xce,0x6c],
|
|
19
|
+
headerExt: [0xb5,0x03,0xbf,0x5f,0x2e,0xa9,0xcf,0x11,0x8e,0xe3,0x00,0xc0,0x0c,0x20,0x53,0x65],
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function guidEq(buf, off, guid) {
|
|
23
|
+
for (let i = 0; i < 16; i++) if (buf[off + i] !== guid[i]) return false
|
|
24
|
+
return true
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Little-endian readers
|
|
28
|
+
function u16(b, o) { return b[o] | (b[o + 1] << 8) }
|
|
29
|
+
function u32(b, o) { return (b[o] | (b[o + 1] << 8) | (b[o + 2] << 16) | (b[o + 3] << 24)) >>> 0 }
|
|
30
|
+
function u64(b, o) {
|
|
31
|
+
// JS safe up to 2^53; read low 32 + high 32
|
|
32
|
+
let lo = u32(b, o), hi = u32(b, o + 4)
|
|
33
|
+
return hi * 0x100000000 + lo
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Parse ASF container — extract audio stream properties + data packets
|
|
38
|
+
* @param {Uint8Array} buf
|
|
39
|
+
* @returns {{ channels, sampleRate, bitRate, blockAlign, bitsPerSample, formatTag, codecData, duration, packetSize, packets }}
|
|
40
|
+
*/
|
|
41
|
+
export function demuxASF(buf) {
|
|
42
|
+
if (!(buf instanceof Uint8Array)) buf = new Uint8Array(buf)
|
|
43
|
+
if (buf.length < 30) throw Error('Not an ASF/WMA file')
|
|
44
|
+
|
|
45
|
+
// Verify ASF Header Object GUID
|
|
46
|
+
if (!guidEq(buf, 0, GUID.header)) throw Error('Not an ASF/WMA file')
|
|
47
|
+
|
|
48
|
+
let headerSize = u64(buf, 16)
|
|
49
|
+
let numObjects = u32(buf, 24)
|
|
50
|
+
// reserved1(1) + reserved2(1) at offset 28-29
|
|
51
|
+
|
|
52
|
+
let audio = null // WAVEFORMATEX fields
|
|
53
|
+
let packetSize = 0
|
|
54
|
+
let duration = 0 // in seconds
|
|
55
|
+
let datOff = 0 // data object offset
|
|
56
|
+
let datSize = 0 // data object total size
|
|
57
|
+
let totalPackets = 0
|
|
58
|
+
|
|
59
|
+
// Parse header sub-objects
|
|
60
|
+
let pos = 30
|
|
61
|
+
let headerEnd = Math.min(Number(headerSize), buf.length)
|
|
62
|
+
for (let i = 0; i < numObjects && pos < headerEnd - 24; i++) {
|
|
63
|
+
let objSize = u64(buf, pos + 16)
|
|
64
|
+
if (objSize < 24) break
|
|
65
|
+
let objEnd = pos + Math.min(Number(objSize), headerEnd - pos)
|
|
66
|
+
|
|
67
|
+
if (guidEq(buf, pos, GUID.streamProps)) {
|
|
68
|
+
audio = parseStreamProps(buf, pos + 24, objEnd) || audio
|
|
69
|
+
} else if (guidEq(buf, pos, GUID.fileProps)) {
|
|
70
|
+
let fp = parseFileProps(buf, pos + 24, objEnd)
|
|
71
|
+
if (fp) { packetSize = fp.packetSize; duration = fp.duration }
|
|
72
|
+
} else if (guidEq(buf, pos, GUID.headerExt)) {
|
|
73
|
+
// Header Extension Object — nested sub-objects skipped (no metadata needed for decode)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
pos = objEnd
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (!audio) throw Error('No audio stream in ASF')
|
|
80
|
+
|
|
81
|
+
// Find Data Object after header
|
|
82
|
+
pos = Number(headerSize)
|
|
83
|
+
if (pos + 50 <= buf.length && guidEq(buf, pos, GUID.data)) {
|
|
84
|
+
datSize = u64(buf, pos + 16)
|
|
85
|
+
// fileId(16) + totalPackets(8) + reserved(2) = 26 bytes after object header
|
|
86
|
+
totalPackets = u64(buf, pos + 24 + 16)
|
|
87
|
+
datOff = pos + 24 + 26 // start of packet data
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Extract packets
|
|
91
|
+
let packets = []
|
|
92
|
+
if (datOff && packetSize > 0) {
|
|
93
|
+
let datEnd = Math.min(pos + Number(datSize), buf.length)
|
|
94
|
+
let ppos = datOff
|
|
95
|
+
while (ppos + packetSize <= datEnd) {
|
|
96
|
+
packets.push(buf.subarray(ppos, ppos + packetSize))
|
|
97
|
+
ppos += packetSize
|
|
98
|
+
}
|
|
99
|
+
} else if (datOff && totalPackets > 0) {
|
|
100
|
+
// Variable-size packets — fallback: treat remaining data as one blob
|
|
101
|
+
let datEnd = Math.min(pos + Number(datSize), buf.length)
|
|
102
|
+
if (datOff < datEnd) packets.push(buf.subarray(datOff, datEnd))
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
channels: audio.channels,
|
|
107
|
+
sampleRate: audio.sampleRate,
|
|
108
|
+
bitRate: audio.avgBytesPerSec * 8,
|
|
109
|
+
blockAlign: audio.blockAlign,
|
|
110
|
+
bitsPerSample: audio.bitsPerSample,
|
|
111
|
+
formatTag: audio.formatTag,
|
|
112
|
+
codecData: audio.codecData,
|
|
113
|
+
duration,
|
|
114
|
+
packetSize,
|
|
115
|
+
packets
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Parse Stream Properties Object body
|
|
121
|
+
* Returns audio WAVEFORMATEX fields if this is an audio stream, null otherwise
|
|
122
|
+
*/
|
|
123
|
+
function parseStreamProps(buf, start, end) {
|
|
124
|
+
// Stream Type GUID(16) + Error Correction Type GUID(16) + Time Offset(8)
|
|
125
|
+
// + Type-Specific Data Length(4) + Error Correction Data Length(4)
|
|
126
|
+
// + Flags(2) + Reserved(4)
|
|
127
|
+
if (start + 54 > end) return null
|
|
128
|
+
|
|
129
|
+
// Check that stream type is Audio Media
|
|
130
|
+
if (!guidEq(buf, start, GUID.audioMedia)) return null
|
|
131
|
+
|
|
132
|
+
// flags(2) + reserved(4) = 6 bytes after type/ec data lengths
|
|
133
|
+
let waveOff = start + 54
|
|
134
|
+
|
|
135
|
+
if (waveOff + 18 > end) return null
|
|
136
|
+
|
|
137
|
+
// WAVEFORMATEX
|
|
138
|
+
let formatTag = u16(buf, waveOff)
|
|
139
|
+
let channels = u16(buf, waveOff + 2)
|
|
140
|
+
let sampleRate = u32(buf, waveOff + 4)
|
|
141
|
+
let avgBytesPerSec = u32(buf, waveOff + 8)
|
|
142
|
+
let blockAlign = u16(buf, waveOff + 12)
|
|
143
|
+
let bitsPerSample = u16(buf, waveOff + 14)
|
|
144
|
+
let cbSize = u16(buf, waveOff + 16)
|
|
145
|
+
|
|
146
|
+
// Codec-specific data follows WAVEFORMATEX
|
|
147
|
+
let codecData = null
|
|
148
|
+
if (cbSize > 0 && waveOff + 18 + cbSize <= end) {
|
|
149
|
+
codecData = buf.subarray(waveOff + 18, waveOff + 18 + cbSize)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return { formatTag, channels, sampleRate, avgBytesPerSec, blockAlign, bitsPerSample, codecData }
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Parse File Properties Object body
|
|
157
|
+
* Returns { packetSize, duration } or null
|
|
158
|
+
*/
|
|
159
|
+
function parseFileProps(buf, start, end) {
|
|
160
|
+
// File ID(16) + File Size(8) + Creation Date(8) + Data Packets Count(8)
|
|
161
|
+
// + Play Duration(8) + Send Duration(8) + Preroll(8)
|
|
162
|
+
// + Flags(4) + Min Data Packet Size(4) + Max Data Packet Size(4)
|
|
163
|
+
// + Max Bitrate(4)
|
|
164
|
+
if (start + 80 > end) return null
|
|
165
|
+
|
|
166
|
+
// Play Duration is 100-ns units (offset 40)
|
|
167
|
+
let playDur = u64(buf, start + 40)
|
|
168
|
+
// Preroll in ms (offset 56)
|
|
169
|
+
let preroll = u64(buf, start + 56)
|
|
170
|
+
// Duration in seconds
|
|
171
|
+
let duration = Math.max(0, playDur / 10000000 - preroll / 1000)
|
|
172
|
+
|
|
173
|
+
// Max packet size at offset 72 (min at 68, always equal for WMA)
|
|
174
|
+
let packetSize = u32(buf, start + 72)
|
|
175
|
+
|
|
176
|
+
return { packetSize, duration }
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Parse ASF data packet — extract compressed audio payload(s)
|
|
181
|
+
* Returns array of payload buffers
|
|
182
|
+
*/
|
|
183
|
+
export function parsePacket(pkt, packetSize) {
|
|
184
|
+
if (!pkt || pkt.length < 3) return []
|
|
185
|
+
|
|
186
|
+
let pos = 0
|
|
187
|
+
|
|
188
|
+
// Error Correction — first byte flags
|
|
189
|
+
let ecFlags = pkt[pos++]
|
|
190
|
+
if (ecFlags & 0x80) {
|
|
191
|
+
// Error correction present
|
|
192
|
+
let ecLen = ecFlags & 0x0F
|
|
193
|
+
// Opaque data flag is bit 4
|
|
194
|
+
pos += ecLen
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (pos >= pkt.length) return []
|
|
198
|
+
|
|
199
|
+
// Payload Parsing Information
|
|
200
|
+
let ppFlags = pkt[pos++]
|
|
201
|
+
let lenFlags = pkt[pos++]
|
|
202
|
+
|
|
203
|
+
let multiplePayloads = !!(ppFlags & 0x01)
|
|
204
|
+
let seqType = (ppFlags >> 1) & 0x03
|
|
205
|
+
let padType = (ppFlags >> 3) & 0x03
|
|
206
|
+
let pktLenType = (ppFlags >> 5) & 0x03
|
|
207
|
+
|
|
208
|
+
let repType = lenFlags & 0x03
|
|
209
|
+
let offType = (lenFlags >> 2) & 0x03
|
|
210
|
+
let medNumType = (lenFlags >> 4) & 0x03
|
|
211
|
+
|
|
212
|
+
// Skip optional packet length field
|
|
213
|
+
if (pktLenType === 1) pos += 1
|
|
214
|
+
else if (pktLenType === 2) pos += 2
|
|
215
|
+
else if (pktLenType === 3) pos += 4
|
|
216
|
+
|
|
217
|
+
// Sequence (skip)
|
|
218
|
+
if (seqType === 1) pos += 1
|
|
219
|
+
else if (seqType === 2) pos += 2
|
|
220
|
+
else if (seqType === 3) pos += 4
|
|
221
|
+
|
|
222
|
+
// Padding length
|
|
223
|
+
let padLen = 0
|
|
224
|
+
if (padType === 1) { padLen = pkt[pos++] }
|
|
225
|
+
else if (padType === 2) { padLen = u16(pkt, pos); pos += 2 }
|
|
226
|
+
else if (padType === 3) { padLen = u32(pkt, pos); pos += 4 }
|
|
227
|
+
|
|
228
|
+
// Send time (4 bytes) + duration (2 bytes)
|
|
229
|
+
pos += 6
|
|
230
|
+
|
|
231
|
+
if (pos >= pkt.length) return []
|
|
232
|
+
|
|
233
|
+
let payloads = []
|
|
234
|
+
|
|
235
|
+
if (!multiplePayloads) {
|
|
236
|
+
// Single payload — rest of packet minus padding
|
|
237
|
+
pos += 1 // stream number (always 1 byte)
|
|
238
|
+
|
|
239
|
+
// Media object number
|
|
240
|
+
pos += fieldSize(medNumType)
|
|
241
|
+
|
|
242
|
+
// Offset into media object
|
|
243
|
+
pos += fieldSize(offType)
|
|
244
|
+
|
|
245
|
+
// Replicated data length
|
|
246
|
+
let repLen = readVarField(pkt, pos, repType)
|
|
247
|
+
pos += fieldSize(repType)
|
|
248
|
+
|
|
249
|
+
// Skip replicated data
|
|
250
|
+
if (repLen === 1) {
|
|
251
|
+
// Compressed payload: repLen==1 means compressed
|
|
252
|
+
pos += 1 // presentation time delta
|
|
253
|
+
} else {
|
|
254
|
+
pos += repLen
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
let payloadLen = pkt.length - pos - padLen
|
|
258
|
+
if (payloadLen > 0 && pos + payloadLen <= pkt.length) {
|
|
259
|
+
payloads.push(pkt.subarray(pos, pos + payloadLen))
|
|
260
|
+
}
|
|
261
|
+
} else {
|
|
262
|
+
// Multiple payloads
|
|
263
|
+
let payloadFlags = pkt[pos++]
|
|
264
|
+
let numPayloads = payloadFlags & 0x3F
|
|
265
|
+
let payLenType = (payloadFlags >> 6) & 0x03
|
|
266
|
+
|
|
267
|
+
for (let i = 0; i < numPayloads && pos < pkt.length; i++) {
|
|
268
|
+
// Stream number (1 byte, lower 7 = number, bit 7 = key frame)
|
|
269
|
+
pos += 1
|
|
270
|
+
|
|
271
|
+
// Media object number
|
|
272
|
+
pos += fieldSize(medNumType)
|
|
273
|
+
|
|
274
|
+
// Offset into media object
|
|
275
|
+
pos += fieldSize(offType)
|
|
276
|
+
|
|
277
|
+
// Replicated data
|
|
278
|
+
let repLen = readVarField(pkt, pos, repType)
|
|
279
|
+
pos += fieldSize(repType)
|
|
280
|
+
|
|
281
|
+
if (repLen === 1) {
|
|
282
|
+
pos += 1 // compressed: presentation time delta
|
|
283
|
+
} else {
|
|
284
|
+
pos += repLen
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Payload length
|
|
288
|
+
let payLen = 0
|
|
289
|
+
if (payLenType === 1) { payLen = pkt[pos++] }
|
|
290
|
+
else if (payLenType === 2) { payLen = u16(pkt, pos); pos += 2 }
|
|
291
|
+
else if (payLenType === 3) { payLen = u32(pkt, pos); pos += 4 }
|
|
292
|
+
else { payLen = pkt.length - pos }
|
|
293
|
+
|
|
294
|
+
if (payLen > 0 && pos + payLen <= pkt.length) {
|
|
295
|
+
payloads.push(pkt.subarray(pos, pos + payLen))
|
|
296
|
+
}
|
|
297
|
+
pos += payLen
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
return payloads
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function fieldSize(type) {
|
|
305
|
+
return type === 0 ? 0 : type === 1 ? 1 : type === 2 ? 2 : 4
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
function readVarField(buf, off, type) {
|
|
309
|
+
if (type === 0) return 0
|
|
310
|
+
if (type === 1) return buf[off] || 0
|
|
311
|
+
if (type === 2) return (off + 2 <= buf.length) ? u16(buf, off) : 0
|
|
312
|
+
return (off + 4 <= buf.length) ? u32(buf, off) : 0
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// ===== WMA format tag names =====
|
|
316
|
+
|
|
317
|
+
const WMA_FORMATS = {
|
|
318
|
+
0x0160: 'WMAv1',
|
|
319
|
+
0x0161: 'WMAv2',
|
|
320
|
+
0x0162: 'WMAPro',
|
|
321
|
+
0x0163: 'WMALossless',
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// ===== WASM module loader =====
|
|
325
|
+
|
|
326
|
+
let _modP
|
|
327
|
+
|
|
328
|
+
async function getMod() {
|
|
329
|
+
if (_modP) return _modP
|
|
330
|
+
let p = createWMA()
|
|
331
|
+
_modP = p
|
|
332
|
+
try { return await p }
|
|
333
|
+
catch (e) { _modP = null; throw e }
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Whole-file decode
|
|
338
|
+
* @param {Uint8Array|ArrayBuffer} src
|
|
339
|
+
* @returns {Promise<{channelData: Float32Array[], sampleRate: number}>}
|
|
340
|
+
*/
|
|
341
|
+
export default async function decode(src) {
|
|
342
|
+
let buf = src instanceof Uint8Array ? src : new Uint8Array(src)
|
|
343
|
+
let dec = await decoder()
|
|
344
|
+
try {
|
|
345
|
+
return dec.decode(buf)
|
|
346
|
+
} finally {
|
|
347
|
+
dec.free()
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Create decoder instance
|
|
353
|
+
* @returns {Promise<{decode(chunk: Uint8Array): {channelData, sampleRate}, flush(), free()}>}
|
|
354
|
+
*/
|
|
355
|
+
export async function decoder() {
|
|
356
|
+
return new WMADecoder(await getMod())
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
class WMADecoder {
|
|
360
|
+
constructor(mod) {
|
|
361
|
+
this.m = mod
|
|
362
|
+
this.h = null
|
|
363
|
+
this.sr = 0
|
|
364
|
+
this.ch = 0
|
|
365
|
+
this.done = false
|
|
366
|
+
this._ptr = 0
|
|
367
|
+
this._cap = 0
|
|
368
|
+
this._meta = null // parsed ASF metadata
|
|
369
|
+
this._left = null // leftover bytes (partial packet)
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
decode(data) {
|
|
373
|
+
if (this.done) throw Error('Decoder already freed')
|
|
374
|
+
if (!data || !data.byteLength) return EMPTY
|
|
375
|
+
|
|
376
|
+
let buf = data instanceof Uint8Array ? data : new Uint8Array(data)
|
|
377
|
+
if (this._left) { buf = catW(this._left, buf); this._left = null }
|
|
378
|
+
|
|
379
|
+
// Phase 1: parse header, init WASM, decode initial packets
|
|
380
|
+
if (!this._meta) {
|
|
381
|
+
let asf
|
|
382
|
+
try { asf = demuxASF(buf) } catch {
|
|
383
|
+
this._left = buf.slice()
|
|
384
|
+
return EMPTY
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
if (!asf.packets.length && !asf.packetSize) return EMPTY
|
|
388
|
+
|
|
389
|
+
let fmt = WMA_FORMATS[asf.formatTag]
|
|
390
|
+
if (!fmt) throw Error('Unsupported WMA format tag: 0x' + asf.formatTag.toString(16))
|
|
391
|
+
this.sr = asf.sampleRate
|
|
392
|
+
this.ch = asf.channels
|
|
393
|
+
this._meta = asf
|
|
394
|
+
|
|
395
|
+
let m = this.m
|
|
396
|
+
let extraPtr = 0, extraLen = 0
|
|
397
|
+
if (asf.codecData?.length) {
|
|
398
|
+
extraPtr = this._alloc(asf.codecData.length)
|
|
399
|
+
m.HEAPU8.set(asf.codecData, extraPtr)
|
|
400
|
+
extraLen = asf.codecData.length
|
|
401
|
+
}
|
|
402
|
+
this.h = m._wma_create(
|
|
403
|
+
asf.channels, asf.sampleRate, asf.bitRate,
|
|
404
|
+
asf.blockAlign, asf.formatTag, asf.bitsPerSample,
|
|
405
|
+
extraPtr, extraLen
|
|
406
|
+
)
|
|
407
|
+
if (!this.h) throw Error('WMA decoder init failed')
|
|
408
|
+
|
|
409
|
+
// Compute data start + consumed offset to keep leftover
|
|
410
|
+
let headerSize = u64(buf, 16)
|
|
411
|
+
let datOff = Number(headerSize) + 50
|
|
412
|
+
let consumed = datOff + asf.packets.length * asf.packetSize
|
|
413
|
+
if (consumed < buf.length) this._left = buf.subarray(consumed).slice()
|
|
414
|
+
|
|
415
|
+
if (!asf.packets.length) return EMPTY
|
|
416
|
+
return this._decodePkts(asf.packets, asf)
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// Phase 2: incremental — extract fixed-size packets from new data
|
|
420
|
+
let ps = this._meta.packetSize
|
|
421
|
+
if (!ps) { this._left = buf; return EMPTY } // variable-size: accumulate, decode on flush
|
|
422
|
+
let pkts = []
|
|
423
|
+
let pos = 0
|
|
424
|
+
while (pos + ps <= buf.length) {
|
|
425
|
+
pkts.push(buf.subarray(pos, pos + ps))
|
|
426
|
+
pos += ps
|
|
427
|
+
}
|
|
428
|
+
if (pos < buf.length) this._left = buf.subarray(pos).slice()
|
|
429
|
+
if (!pkts.length) return EMPTY
|
|
430
|
+
return this._decodePkts(pkts, this._meta)
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
_decodePkts(pkts, asf) {
|
|
434
|
+
let m = this.m
|
|
435
|
+
let chunks = [], totalPerCh = 0, channels = this.ch, errors = 0
|
|
436
|
+
let ba = asf.blockAlign
|
|
437
|
+
|
|
438
|
+
for (let pkt of pkts) {
|
|
439
|
+
let payloads = parsePacket(pkt, asf.packetSize)
|
|
440
|
+
for (let payload of payloads) {
|
|
441
|
+
for (let off = 0; off + ba <= payload.length; off += ba) {
|
|
442
|
+
let frame = payload.subarray(off, off + ba)
|
|
443
|
+
let ptr = this._alloc(ba)
|
|
444
|
+
m.HEAPU8.set(frame, ptr)
|
|
445
|
+
let out = m._wma_decode(this.h, ptr, ba)
|
|
446
|
+
if (!out) { errors++; continue }
|
|
447
|
+
|
|
448
|
+
let n = m._wma_samples()
|
|
449
|
+
let sr = m._wma_samplerate()
|
|
450
|
+
if (sr) this.sr = sr
|
|
451
|
+
let ch = m._wma_channels()
|
|
452
|
+
if (ch) channels = ch
|
|
453
|
+
|
|
454
|
+
let spc = n / channels
|
|
455
|
+
chunks.push({ data: new Float32Array(m.HEAPF32.buffer, out, n).slice(), ch: channels, spc })
|
|
456
|
+
totalPerCh += spc
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
if (!totalPerCh) {
|
|
462
|
+
if (errors) throw Error(errors + ' frame(s) failed to decode')
|
|
463
|
+
return EMPTY
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
let channelData = Array.from({ length: channels }, () => new Float32Array(totalPerCh))
|
|
467
|
+
let pos = 0
|
|
468
|
+
for (let { data, ch, spc } of chunks) {
|
|
469
|
+
for (let c = 0; c < ch; c++) {
|
|
470
|
+
let out = channelData[c]
|
|
471
|
+
for (let s = 0; s < spc; s++) out[pos + s] = data[s * ch + c]
|
|
472
|
+
}
|
|
473
|
+
pos += spc
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
return { channelData, sampleRate: this.sr }
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
flush() {
|
|
480
|
+
let r = EMPTY
|
|
481
|
+
if (this._left && this._meta && !this._meta.packetSize) r = this._decodePkts([this._left], this._meta)
|
|
482
|
+
this._left = null
|
|
483
|
+
return r
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
free() {
|
|
487
|
+
if (this.done) return
|
|
488
|
+
this.done = true
|
|
489
|
+
if (this.h) {
|
|
490
|
+
this.m._wma_close(this.h)
|
|
491
|
+
this.m._wma_free_buf()
|
|
492
|
+
this.h = null
|
|
493
|
+
}
|
|
494
|
+
if (this._ptr) {
|
|
495
|
+
this.m._free(this._ptr)
|
|
496
|
+
this._ptr = 0
|
|
497
|
+
this._cap = 0
|
|
498
|
+
}
|
|
499
|
+
this._left = null; this._meta = null
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
_alloc(len) {
|
|
503
|
+
if (len > this._cap) {
|
|
504
|
+
if (this._ptr) this.m._free(this._ptr)
|
|
505
|
+
this._cap = len
|
|
506
|
+
this._ptr = this.m._malloc(len)
|
|
507
|
+
}
|
|
508
|
+
return this._ptr
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
function catW(a, b) {
|
|
513
|
+
let r = new Uint8Array(a.length + b.length)
|
|
514
|
+
r.set(a); r.set(b, a.length)
|
|
515
|
+
return r
|
|
516
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@audio/decode-wma",
|
|
3
|
+
"version": "1.3.1",
|
|
4
|
+
"description": "Decode WMA audio via RockBox WASM",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "decode-wma.js",
|
|
7
|
+
"types": "decode-wma.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./decode-wma.js",
|
|
10
|
+
"./audio": {
|
|
11
|
+
"types": "./audio.d.ts",
|
|
12
|
+
"default": "./audio.js"
|
|
13
|
+
},
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"decode-wma.js",
|
|
18
|
+
"decode-wma.d.ts",
|
|
19
|
+
"src/wma.wasm.js",
|
|
20
|
+
"LICENSE",
|
|
21
|
+
"audio.js",
|
|
22
|
+
"audio.d.ts"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "bash build.sh",
|
|
26
|
+
"prepack": "npm run build",
|
|
27
|
+
"test": "node test.js"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"wma",
|
|
31
|
+
"windows-media-audio",
|
|
32
|
+
"asf",
|
|
33
|
+
"audio",
|
|
34
|
+
"decode",
|
|
35
|
+
"decoder",
|
|
36
|
+
"wasm",
|
|
37
|
+
"rockbox"
|
|
38
|
+
],
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"license": "GPL-2.0-or-later",
|
|
43
|
+
"author": "audiojs",
|
|
44
|
+
"homepage": "https://github.com/audiojs/decode/tree/master/packages/decode-wma#readme",
|
|
45
|
+
"bugs": "https://github.com/audiojs/decode/issues",
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/audiojs/decode.git",
|
|
49
|
+
"directory": "packages/decode-wma"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=18"
|
|
53
|
+
},
|
|
54
|
+
"audio": "./audio.js",
|
|
55
|
+
"sideEffects": false,
|
|
56
|
+
"funding": "https://github.com/sponsors/audiojs"
|
|
57
|
+
}
|
|
@@ -1,54 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "audio-decode",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Decode audio
|
|
5
|
-
"main": "audio-decode.js",
|
|
6
|
-
"module": "audio-decode.js",
|
|
7
|
-
"browser": "audio-decode.js",
|
|
3
|
+
"version": "3.12.0",
|
|
4
|
+
"description": "Decode audio to AudioBuffer; unscoped alias of @audio/decode",
|
|
8
5
|
"type": "module",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"node-wav": "^0.0.2",
|
|
17
|
-
"ogg-opus-decoder": "^1.6.12",
|
|
18
|
-
"qoa-format": "^1.0.1"
|
|
19
|
-
},
|
|
20
|
-
"devDependencies": {
|
|
21
|
-
"audio-lena": "^2.3.0",
|
|
22
|
-
"base64-arraybuffer": "^1.0.2",
|
|
23
|
-
"tst": "^7.3.0"
|
|
24
|
-
},
|
|
25
|
-
"scripts": {
|
|
26
|
-
"test": "node test.js"
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"main": "audio-decode.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./audio-decode.js",
|
|
10
|
+
"./stream": "./stream.js",
|
|
11
|
+
"./meta": "./meta.js",
|
|
12
|
+
"./package.json": "./package.json"
|
|
27
13
|
},
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
14
|
+
"files": [
|
|
15
|
+
"audio-decode.js",
|
|
16
|
+
"stream.js",
|
|
17
|
+
"meta.js",
|
|
18
|
+
"audio-decode.d.ts",
|
|
19
|
+
"stream.d.ts"
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@audio/decode": "^3.11.1"
|
|
31
23
|
},
|
|
32
24
|
"keywords": [
|
|
33
|
-
"audiojs",
|
|
34
25
|
"audio",
|
|
35
|
-
"dsp",
|
|
36
26
|
"decode",
|
|
37
|
-
"audio decode",
|
|
38
|
-
"audio decoder",
|
|
39
|
-
"web audio decoder",
|
|
40
|
-
"codec",
|
|
41
|
-
"mp3",
|
|
42
27
|
"wav",
|
|
28
|
+
"mp3",
|
|
29
|
+
"flac",
|
|
43
30
|
"ogg",
|
|
44
|
-
"vorbis",
|
|
45
31
|
"opus",
|
|
46
|
-
"
|
|
32
|
+
"aac",
|
|
33
|
+
"audiobuffer"
|
|
47
34
|
],
|
|
48
|
-
"author": "ΔY <dfcreative@gmail.com>",
|
|
49
35
|
"license": "MIT",
|
|
50
|
-
"
|
|
51
|
-
|
|
36
|
+
"author": "Dmitry Iv. <dfcreative@gmail.com>",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/audiojs/decode.git",
|
|
40
|
+
"directory": "packages/audio-decode"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/audiojs/decode/tree/master/packages/audio-decode#readme",
|
|
43
|
+
"bugs": "https://github.com/audiojs/decode/issues",
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
52
49
|
},
|
|
53
|
-
"
|
|
50
|
+
"funding": "https://github.com/sponsors/audiojs",
|
|
51
|
+
"types": "audio-decode.d.ts"
|
|
54
52
|
}
|