@openclaw/whatsapp 2026.9.6 → 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.
Files changed (354) hide show
  1. package/assets/icon.png +0 -0
  2. package/dist/.setup/{accounts-D_NGDjCx.mjs → accounts-CtRPAQCL.mjs} +3 -9
  3. package/dist/.setup/{action-runtime-DZZFamfl.mjs → action-runtime-DeVk5V7r.mjs} +2 -2
  4. package/dist/.setup/{approval-handler.runtime-C0hzmMSj.mjs → approval-handler.runtime-CjqMlPOX.mjs} +6 -26
  5. package/dist/.setup/{approval-reactions-BnXw-UZI.mjs → approval-reactions-DiOFvb1s.mjs} +8 -14
  6. package/dist/.setup/{auth-store-Dh8a3cba.mjs → auth-store-BBonwKks.mjs} +9 -33
  7. package/dist/.setup/{channel-Bg_fS2iF.mjs → channel-CJFE0kD_.mjs} +82 -154
  8. package/dist/.setup/{channel-react-action-1iBiEnq7.mjs → channel-react-action-2r_hjLZV.mjs} +4 -8
  9. package/dist/.setup/{channel.runtime-rurG-kbr.mjs → channel.runtime-C94goLw9.mjs} +4 -4
  10. package/dist/.setup/{channel.setup-C8P5q8uD.mjs → channel.setup-CfN1UfdY.mjs} +1 -1
  11. package/dist/.setup/{connection-controller-C60mU7j7.mjs → connection-controller-CHo1oRJA.mjs} +13 -63
  12. package/dist/.setup/{creds-files-Drg3usj1.mjs → creds-files-CDATZWWM.mjs} +5 -11
  13. package/dist/.setup/{directory-config-BHPoBklt.mjs → directory-config-DUiJ5d8I.mjs} +13 -14
  14. package/dist/.setup/doctor-iMwg0Vhr.mjs +222 -0
  15. package/dist/.setup/group-config-path-DZr3ucUO.mjs +40 -0
  16. package/dist/.setup/{group-session-key-D22hYMdE.mjs → group-session-key-2-mja4OF.mjs} +3 -9
  17. package/dist/.setup/{login-2dmd1TfE.mjs → login-BFlvSh9h.mjs} +9 -11
  18. package/dist/.setup/{login-qr-CgKtO_ef.mjs → login-qr-Ayb8i25J.mjs} +29 -77
  19. package/dist/.setup/{monitor-By82ehLA.mjs → monitor-CGpV2VNN.mjs} +376 -504
  20. package/dist/.setup/{question-reactions-D3Zq9Gbn.mjs → question-reactions-CPyyi5AY.mjs} +2 -2
  21. package/dist/.setup/rolldown-runtime-BBjsoOtd.mjs +27 -0
  22. package/dist/.setup/{send-C6jDmcL9.mjs → send-BGdvf5cC.mjs} +31 -80
  23. package/dist/.setup/{send-api-B4DOt2RJ.mjs → send-api-H4AkQJjT.mjs} +45 -109
  24. package/dist/.setup/{session-errors-JuazczrA.mjs → session-errors-B8UcAnZN.mjs} +1 -4
  25. package/dist/.setup/{session.runtime-DcJuO42v.mjs → session.runtime-st1konFI.mjs} +1 -1
  26. package/dist/.setup/{setup-finalize-pGqWOiFX.mjs → setup-finalize-DmPX4EaW.mjs} +32 -70
  27. package/dist/.setup/setup-plugin-api-vJlxKzca.mjs +3 -0
  28. package/dist/.setup/{setup-surface-B9CYwDPZ.mjs → setup-surface-43fj197P.mjs} +3 -3
  29. package/dist/.setup/{shared-DVgQ8kRG.mjs → shared-DgOG5Iqr.mjs} +26 -37
  30. package/dist/.setup/{socket-close-CCVSFufF.mjs → socket-close-CT__V2fz.mjs} +80 -92
  31. package/dist/.setup/{targets-runtime-RBjx3pg_.mjs → targets-runtime-DmiqXIXO.mjs} +2 -7
  32. package/dist/action-runtime-api.js +1 -1
  33. package/dist/action-runtime.runtime.js +1 -1
  34. package/dist/agent-tools-api.js +5 -12
  35. package/dist/api.js +10 -10
  36. package/dist/auth-presence.js +1 -1
  37. package/dist/channel-plugin-api.js +1 -1
  38. package/dist/contract-api.js +2 -2
  39. package/dist/directory-contract-api.js +1 -1
  40. package/dist/doctor-contract-api.js +9 -10
  41. package/dist/light-runtime-api.js +2 -2
  42. package/dist/login-qr-runtime.js +1 -1
  43. package/dist/runtime-api.js +9 -9
  44. package/dist/setup-entry.js +1 -1
  45. package/dist/setup-plugin-api.js +1 -1
  46. package/node_modules/audio-decode/LICENSE +9 -10
  47. package/node_modules/audio-decode/README.md +16 -0
  48. package/node_modules/audio-decode/audio-decode.d.ts +2 -14
  49. package/node_modules/audio-decode/audio-decode.js +4 -92
  50. package/node_modules/audio-decode/meta.js +1 -0
  51. package/node_modules/audio-decode/node_modules/{audio-buffer → @audio/decode}/LICENSE +1 -1
  52. package/node_modules/audio-decode/node_modules/@audio/decode/audio-decode.d.ts +52 -0
  53. package/node_modules/audio-decode/node_modules/@audio/decode/audio-decode.js +242 -0
  54. package/node_modules/audio-decode/node_modules/@audio/decode/meta.js +14 -0
  55. package/node_modules/audio-decode/node_modules/@audio/decode/package.json +114 -0
  56. package/node_modules/audio-decode/node_modules/@audio/decode/readme.md +191 -0
  57. package/node_modules/audio-decode/node_modules/@audio/decode/stream.d.ts +12 -0
  58. package/node_modules/audio-decode/node_modules/@audio/decode/stream.js +1 -0
  59. package/node_modules/audio-decode/node_modules/@audio/decode/test.html +52 -0
  60. package/node_modules/audio-decode/node_modules/@audio/decode-aac/LICENSE +9 -0
  61. package/node_modules/audio-decode/node_modules/@audio/decode-aac/README.md +80 -0
  62. package/node_modules/audio-decode/node_modules/@audio/decode-aac/alac.js +326 -0
  63. package/node_modules/audio-decode/node_modules/@audio/decode-aac/audio.d.ts +15 -0
  64. package/node_modules/audio-decode/node_modules/@audio/decode-aac/audio.js +10 -0
  65. package/node_modules/audio-decode/node_modules/@audio/decode-aac/decode-aac.d.ts +24 -0
  66. package/node_modules/audio-decode/node_modules/@audio/decode-aac/decode-aac.js +452 -0
  67. package/node_modules/audio-decode/node_modules/@audio/decode-aac/meta.js +81 -0
  68. package/node_modules/audio-decode/node_modules/@audio/decode-aac/package.json +63 -0
  69. package/node_modules/audio-decode/node_modules/@audio/decode-aac/src/aac.wasm.js +0 -0
  70. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/LICENSE +12 -0
  71. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/LICENSE.liba52 +340 -0
  72. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/README.md +41 -0
  73. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/audio.d.ts +15 -0
  74. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/audio.js +9 -0
  75. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/decode-ac3.d.ts +20 -0
  76. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/decode-ac3.js +131 -0
  77. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/package.json +64 -0
  78. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/src/ac3.wasm.js +0 -0
  79. package/node_modules/audio-decode/node_modules/@audio/decode-aiff/LICENSE +21 -0
  80. package/node_modules/audio-decode/node_modules/@audio/decode-aiff/README.md +46 -0
  81. package/node_modules/audio-decode/node_modules/@audio/decode-aiff/audio.d.ts +15 -0
  82. package/node_modules/audio-decode/node_modules/@audio/decode-aiff/audio.js +10 -0
  83. package/node_modules/audio-decode/node_modules/@audio/decode-aiff/decode-aiff.d.ts +16 -0
  84. package/node_modules/audio-decode/node_modules/@audio/decode-aiff/decode-aiff.js +583 -0
  85. package/node_modules/audio-decode/node_modules/@audio/decode-aiff/package.json +52 -0
  86. package/node_modules/audio-decode/node_modules/@audio/decode-amr/LICENSE +191 -0
  87. package/node_modules/audio-decode/node_modules/@audio/decode-amr/README.md +65 -0
  88. package/node_modules/audio-decode/node_modules/@audio/decode-amr/audio.d.ts +15 -0
  89. package/node_modules/audio-decode/node_modules/@audio/decode-amr/audio.js +10 -0
  90. package/node_modules/audio-decode/node_modules/@audio/decode-amr/decode-amr.d.ts +16 -0
  91. package/node_modules/audio-decode/node_modules/@audio/decode-amr/decode-amr.js +150 -0
  92. package/node_modules/audio-decode/node_modules/@audio/decode-amr/package.json +58 -0
  93. package/node_modules/audio-decode/node_modules/@audio/decode-amr/src/amr.wasm.js +0 -0
  94. package/node_modules/audio-decode/node_modules/@audio/decode-avi/LICENSE +21 -0
  95. package/node_modules/audio-decode/node_modules/@audio/decode-avi/README.md +53 -0
  96. package/node_modules/audio-decode/node_modules/@audio/decode-avi/audio.d.ts +15 -0
  97. package/node_modules/audio-decode/node_modules/@audio/decode-avi/audio.js +9 -0
  98. package/node_modules/audio-decode/node_modules/@audio/decode-avi/decode-avi.d.ts +21 -0
  99. package/node_modules/audio-decode/node_modules/@audio/decode-avi/decode-avi.js +241 -0
  100. package/node_modules/audio-decode/node_modules/@audio/decode-avi/package.json +66 -0
  101. package/node_modules/audio-decode/node_modules/@audio/decode-caf/LICENSE +21 -0
  102. package/node_modules/audio-decode/node_modules/@audio/decode-caf/README.md +48 -0
  103. package/node_modules/audio-decode/node_modules/@audio/decode-caf/audio.d.ts +15 -0
  104. package/node_modules/audio-decode/node_modules/@audio/decode-caf/audio.js +10 -0
  105. package/node_modules/audio-decode/node_modules/@audio/decode-caf/decode-caf.d.ts +16 -0
  106. package/node_modules/audio-decode/node_modules/@audio/decode-caf/decode-caf.js +238 -0
  107. package/node_modules/audio-decode/node_modules/@audio/decode-caf/package.json +53 -0
  108. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/LICENSE +21 -0
  109. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/README.md +73 -0
  110. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/audio.d.ts +21 -0
  111. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/audio.js +15 -0
  112. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/decode-dsd.d.ts +29 -0
  113. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/decode-dsd.js +423 -0
  114. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/meta.js +40 -0
  115. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/package.json +64 -0
  116. package/node_modules/audio-decode/node_modules/@audio/decode-dts/LICENSE +12 -0
  117. package/node_modules/audio-decode/node_modules/@audio/decode-dts/LICENSE.libdca +339 -0
  118. package/node_modules/audio-decode/node_modules/@audio/decode-dts/README.md +41 -0
  119. package/node_modules/audio-decode/node_modules/@audio/decode-dts/audio.d.ts +15 -0
  120. package/node_modules/audio-decode/node_modules/@audio/decode-dts/audio.js +9 -0
  121. package/node_modules/audio-decode/node_modules/@audio/decode-dts/decode-dts.d.ts +20 -0
  122. package/node_modules/audio-decode/node_modules/@audio/decode-dts/decode-dts.js +139 -0
  123. package/node_modules/audio-decode/node_modules/@audio/decode-dts/package.json +64 -0
  124. package/node_modules/audio-decode/node_modules/@audio/decode-dts/src/dts.wasm.js +0 -0
  125. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/LICENSE +12 -0
  126. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/LICENSE.ffmpeg +502 -0
  127. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/README.md +45 -0
  128. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/audio.d.ts +15 -0
  129. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/audio.js +9 -0
  130. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/decode-eac3.d.ts +20 -0
  131. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/decode-eac3.js +124 -0
  132. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/package.json +68 -0
  133. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/src/eac3.wasm.js +0 -0
  134. package/node_modules/audio-decode/node_modules/@audio/decode-flac/LICENSE +25 -0
  135. package/node_modules/audio-decode/node_modules/@audio/decode-flac/README.md +23 -0
  136. package/node_modules/audio-decode/node_modules/@audio/decode-flac/audio.d.ts +15 -0
  137. package/node_modules/audio-decode/node_modules/@audio/decode-flac/audio.js +10 -0
  138. package/node_modules/audio-decode/node_modules/@audio/decode-flac/decode-flac.d.ts +18 -0
  139. package/node_modules/audio-decode/node_modules/@audio/decode-flac/decode-flac.js +3172 -0
  140. package/node_modules/audio-decode/node_modules/@audio/decode-flac/meta.js +115 -0
  141. package/node_modules/audio-decode/node_modules/@audio/decode-flac/package.json +60 -0
  142. package/node_modules/audio-decode/node_modules/@audio/decode-mod/LICENSE +23 -0
  143. package/node_modules/audio-decode/node_modules/@audio/decode-mod/LICENSE.libopenmpt +25 -0
  144. package/node_modules/audio-decode/node_modules/@audio/decode-mod/README.md +86 -0
  145. package/node_modules/audio-decode/node_modules/@audio/decode-mod/audio.d.ts +20 -0
  146. package/node_modules/audio-decode/node_modules/@audio/decode-mod/audio.js +12 -0
  147. package/node_modules/audio-decode/node_modules/@audio/decode-mod/decode-mod.d.ts +58 -0
  148. package/node_modules/audio-decode/node_modules/@audio/decode-mod/decode-mod.js +148 -0
  149. package/node_modules/audio-decode/node_modules/@audio/decode-mod/package.json +68 -0
  150. package/node_modules/audio-decode/node_modules/@audio/decode-mod/src/mod.wasm.js +0 -0
  151. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/LICENSE +25 -0
  152. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/README.md +20 -0
  153. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/audio.d.ts +15 -0
  154. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/audio.js +10 -0
  155. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/decode-mp3.d.ts +16 -0
  156. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/decode-mp3.js +793 -0
  157. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/meta.js +143 -0
  158. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/package.json +60 -0
  159. package/node_modules/audio-decode/node_modules/@audio/decode-mp4/LICENSE +21 -0
  160. package/node_modules/audio-decode/node_modules/@audio/decode-mp4/README.md +58 -0
  161. package/node_modules/audio-decode/node_modules/@audio/decode-mp4/audio.d.ts +15 -0
  162. package/node_modules/audio-decode/node_modules/@audio/decode-mp4/audio.js +9 -0
  163. package/node_modules/audio-decode/node_modules/@audio/decode-mp4/decode-mp4.d.ts +21 -0
  164. package/node_modules/audio-decode/node_modules/@audio/decode-mp4/decode-mp4.js +455 -0
  165. package/node_modules/audio-decode/node_modules/@audio/decode-mp4/package.json +74 -0
  166. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/LICENSE +31 -0
  167. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/LICENSE.libmpcdec +31 -0
  168. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/README.md +60 -0
  169. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/audio.d.ts +15 -0
  170. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/audio.js +9 -0
  171. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/decode-mpc.d.ts +20 -0
  172. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/decode-mpc.js +158 -0
  173. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/package.json +64 -0
  174. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/src/mpc.wasm.js +0 -0
  175. package/node_modules/audio-decode/node_modules/@audio/decode-opus/LICENSE +25 -0
  176. package/node_modules/audio-decode/node_modules/@audio/decode-opus/LICENSE.libopus +44 -0
  177. package/node_modules/audio-decode/node_modules/@audio/decode-opus/README.md +32 -0
  178. package/node_modules/audio-decode/node_modules/@audio/decode-opus/audio.d.ts +15 -0
  179. package/node_modules/audio-decode/node_modules/@audio/decode-opus/audio.js +10 -0
  180. package/node_modules/audio-decode/node_modules/@audio/decode-opus/core.d.ts +33 -0
  181. package/node_modules/audio-decode/node_modules/@audio/decode-opus/core.js +147 -0
  182. package/node_modules/audio-decode/node_modules/@audio/decode-opus/decode-opus.d.ts +18 -0
  183. package/node_modules/audio-decode/node_modules/@audio/decode-opus/decode-opus.js +1 -0
  184. package/node_modules/audio-decode/node_modules/@audio/decode-opus/meta.js +103 -0
  185. package/node_modules/audio-decode/node_modules/@audio/decode-opus/package.json +68 -0
  186. package/node_modules/audio-decode/node_modules/@audio/decode-opus/src/decode-opus.js +2 -0
  187. package/node_modules/audio-decode/node_modules/@audio/decode-opus/src/opus.wasm.js +0 -0
  188. package/node_modules/audio-decode/node_modules/@audio/decode-qoa/LICENSE +25 -0
  189. package/node_modules/audio-decode/node_modules/@audio/decode-qoa/README.md +19 -0
  190. package/node_modules/audio-decode/node_modules/@audio/decode-qoa/audio.d.ts +15 -0
  191. package/node_modules/audio-decode/node_modules/@audio/decode-qoa/audio.js +10 -0
  192. package/node_modules/audio-decode/node_modules/@audio/decode-qoa/decode-qoa.d.ts +16 -0
  193. package/node_modules/audio-decode/node_modules/@audio/decode-qoa/decode-qoa.js +275 -0
  194. package/node_modules/audio-decode/node_modules/@audio/decode-qoa/package.json +56 -0
  195. package/node_modules/audio-decode/node_modules/@audio/decode-tta/LICENSE +21 -0
  196. package/node_modules/audio-decode/node_modules/@audio/decode-tta/LICENSE.ttadec +39 -0
  197. package/node_modules/audio-decode/node_modules/@audio/decode-tta/README.md +58 -0
  198. package/node_modules/audio-decode/node_modules/@audio/decode-tta/audio.d.ts +15 -0
  199. package/node_modules/audio-decode/node_modules/@audio/decode-tta/audio.js +9 -0
  200. package/node_modules/audio-decode/node_modules/@audio/decode-tta/decode-tta.d.ts +17 -0
  201. package/node_modules/audio-decode/node_modules/@audio/decode-tta/decode-tta.js +302 -0
  202. package/node_modules/audio-decode/node_modules/@audio/decode-tta/package.json +58 -0
  203. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/LICENSE +25 -0
  204. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/README.md +33 -0
  205. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/audio.d.ts +15 -0
  206. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/audio.js +10 -0
  207. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/decode-vorbis.d.ts +18 -0
  208. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/decode-vorbis.js +2984 -0
  209. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/meta.js +102 -0
  210. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/package.json +60 -0
  211. package/node_modules/audio-decode/node_modules/@audio/decode-wav/LICENSE +21 -0
  212. package/node_modules/audio-decode/node_modules/@audio/decode-wav/README.md +23 -0
  213. package/node_modules/audio-decode/node_modules/@audio/decode-wav/audio.d.ts +15 -0
  214. package/node_modules/audio-decode/node_modules/@audio/decode-wav/audio.js +10 -0
  215. package/node_modules/audio-decode/node_modules/@audio/decode-wav/decode-wav.d.ts +8 -0
  216. package/node_modules/audio-decode/node_modules/@audio/decode-wav/decode-wav.js +256 -0
  217. package/node_modules/audio-decode/node_modules/@audio/decode-wav/meta.js +114 -0
  218. package/node_modules/audio-decode/node_modules/@audio/decode-wav/package.json +52 -0
  219. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/LICENSE +29 -0
  220. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/LICENSE.wavpack +25 -0
  221. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/README.md +41 -0
  222. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/audio.d.ts +15 -0
  223. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/audio.js +9 -0
  224. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/decode-wavpack.d.ts +18 -0
  225. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/decode-wavpack.js +140 -0
  226. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/package.json +62 -0
  227. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/src/wavpack.wasm.js +0 -0
  228. package/node_modules/audio-decode/node_modules/@audio/decode-webm/LICENSE +21 -0
  229. package/node_modules/audio-decode/node_modules/@audio/decode-webm/LICENSE.libopus +44 -0
  230. package/node_modules/audio-decode/node_modules/@audio/decode-webm/README.md +59 -0
  231. package/node_modules/audio-decode/node_modules/@audio/decode-webm/audio.d.ts +15 -0
  232. package/node_modules/audio-decode/node_modules/@audio/decode-webm/audio.js +10 -0
  233. package/node_modules/audio-decode/node_modules/@audio/decode-webm/decode-webm.d.ts +18 -0
  234. package/node_modules/audio-decode/node_modules/@audio/decode-webm/decode-webm.js +141 -0
  235. package/node_modules/audio-decode/node_modules/@audio/decode-webm/package.json +76 -0
  236. package/node_modules/audio-decode/node_modules/@audio/decode-webm/src/opus.wasm.js +0 -0
  237. package/node_modules/audio-decode/node_modules/@audio/decode-wma/LICENSE +12 -0
  238. package/node_modules/audio-decode/node_modules/@audio/decode-wma/README.md +74 -0
  239. package/node_modules/audio-decode/node_modules/@audio/decode-wma/audio.d.ts +15 -0
  240. package/node_modules/audio-decode/node_modules/@audio/decode-wma/audio.js +10 -0
  241. package/node_modules/audio-decode/node_modules/@audio/decode-wma/decode-wma.d.ts +33 -0
  242. package/node_modules/audio-decode/node_modules/@audio/decode-wma/decode-wma.js +516 -0
  243. package/node_modules/audio-decode/node_modules/@audio/decode-wma/package.json +57 -0
  244. package/node_modules/audio-decode/node_modules/@audio/decode-wma/src/wma.wasm.js +0 -0
  245. package/node_modules/audio-decode/package.json +37 -39
  246. package/node_modules/audio-decode/stream.d.ts +2 -0
  247. package/node_modules/audio-decode/stream.js +2 -0
  248. package/node_modules/baileys/lib/Utils/messages-media.js +1 -1
  249. package/node_modules/baileys/node_modules/file-type/package.json +1 -1
  250. package/node_modules/baileys/node_modules/file-type/readme.md +2 -0
  251. package/node_modules/baileys/node_modules/file-type/source/detectors/zip.js +9 -4
  252. package/node_modules/baileys/package.json +1 -1
  253. package/node_modules/typebox/build/compile/code.mjs +1 -2
  254. package/node_modules/typebox/build/compile/validator.mjs +5 -1
  255. package/node_modules/typebox/build/format/iri.mjs +16 -9
  256. package/node_modules/typebox/build/guard/emit.mjs +2 -2
  257. package/node_modules/typebox/build/guard/guard.d.mts +7 -5
  258. package/node_modules/typebox/build/guard/guard.mjs +14 -9
  259. package/node_modules/typebox/build/guard/index.mjs +6 -0
  260. package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
  261. package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
  262. package/node_modules/typebox/build/guard/{string.mjs → unicode/unicode_segment.mjs} +16 -19
  263. package/node_modules/typebox/build/schema/build.mjs +2 -3
  264. package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
  265. package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
  266. package/node_modules/typebox/build/schema/engine/_refine.mjs +13 -5
  267. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +2 -1
  268. package/node_modules/typebox/build/schema/engine/dependencies.mjs +2 -1
  269. package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +2 -1
  270. package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +1 -1
  271. package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +2 -2
  272. package/node_modules/typebox/build/schema/engine/format.mjs +9 -2
  273. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +3 -2
  274. package/node_modules/typebox/build/schema/engine/properties.mjs +3 -2
  275. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -1
  276. package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +1 -1
  277. package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +2 -2
  278. package/node_modules/typebox/build/schema/engine/ref.d.mts +1 -1
  279. package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
  280. package/node_modules/typebox/build/schema/engine/schema.mjs +24 -24
  281. package/node_modules/typebox/build/schema/parse.mjs +3 -0
  282. package/node_modules/typebox/build/schema/pointer/pointer.d.mts +1 -6
  283. package/node_modules/typebox/build/schema/pointer/pointer.mjs +47 -64
  284. package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
  285. package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
  286. package/node_modules/typebox/build/system/settings/settings.d.mts +11 -0
  287. package/node_modules/typebox/build/system/settings/settings.mjs +14 -0
  288. package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
  289. package/node_modules/typebox/build/type/extends/inference.mjs +15 -2
  290. package/node_modules/typebox/build/type/extends/tuple.d.mts +2 -1
  291. package/node_modules/typebox/build/type/extends/tuple.mjs +21 -1
  292. package/node_modules/typebox/build/value/parse/parse.mjs +10 -4
  293. package/node_modules/typebox/package.json +1 -1
  294. package/node_modules/typebox/readme.md +3 -1
  295. package/package.json +6 -6
  296. package/dist/.setup/doctor-BPb-SjdE.mjs +0 -65
  297. package/dist/.setup/group-config-path-BGyzT9Lg.mjs +0 -54
  298. package/dist/.setup/normalize-DdsROMMa.mjs +0 -2
  299. package/dist/.setup/rolldown-runtime-D7D4PA-g.mjs +0 -13
  300. package/dist/.setup/runtime-group-policy-DeSRFXEV.mjs +0 -11
  301. package/dist/.setup/setup-plugin-api-2wUapweU.mjs +0 -3
  302. package/dist/.setup/text-runtime-CHl0iPYe.mjs +0 -4
  303. package/node_modules/audio-decode/.eslintrc.json +0 -43
  304. package/node_modules/audio-decode/.github/workflows/test.js.yml +0 -31
  305. package/node_modules/audio-decode/.travis.yml +0 -13
  306. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/README.md +0 -293
  307. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/dist/opus-ml-decoder.min.js +0 -11646
  308. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/dist/opus-ml-decoder.min.js.map +0 -1
  309. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/index.js +0 -8
  310. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/package.json +0 -58
  311. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/src/EmscriptenWasm.js +0 -0
  312. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/src/OpusMLDecoder.js +0 -253
  313. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/src/OpusMLDecoderWebWorker.js +0 -17
  314. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/types.d.ts +0 -77
  315. package/node_modules/audio-decode/node_modules/audio-buffer/.eslintrc.json +0 -44
  316. package/node_modules/audio-decode/node_modules/audio-buffer/.github/workflows/node.js.yml +0 -31
  317. package/node_modules/audio-decode/node_modules/audio-buffer/.travis.yml +0 -7
  318. package/node_modules/audio-decode/node_modules/audio-buffer/index.js +0 -76
  319. package/node_modules/audio-decode/node_modules/audio-buffer/package.json +0 -37
  320. package/node_modules/audio-decode/node_modules/audio-buffer/readme.md +0 -56
  321. package/node_modules/audio-decode/node_modules/node-wav/README.md +0 -35
  322. package/node_modules/audio-decode/node_modules/node-wav/file.wav +0 -0
  323. package/node_modules/audio-decode/node_modules/node-wav/index.js +0 -291
  324. package/node_modules/audio-decode/node_modules/node-wav/package.json +0 -29
  325. package/node_modules/audio-decode/node_modules/node-wav/tests/file1.wav +0 -0
  326. package/node_modules/audio-decode/node_modules/node-wav/tests/test.js +0 -66
  327. package/node_modules/audio-decode/node_modules/node-wav/x.js +0 -12
  328. package/node_modules/audio-decode/node_modules/node-wav/x.json +0 -86702
  329. package/node_modules/audio-decode/node_modules/node-wav/x.js~ +0 -13
  330. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/README.md +0 -320
  331. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.min.js +0 -232
  332. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.min.js.map +0 -1
  333. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.opus-ml.min.js +0 -0
  334. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.opus-ml.min.js.map +0 -1
  335. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/index.js +0 -8
  336. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/package.json +0 -74
  337. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/src/OggOpusDecoder.js +0 -226
  338. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/src/OggOpusDecoderWebWorker.js +0 -17
  339. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/types.d.ts +0 -37
  340. package/node_modules/audio-decode/node_modules/opus-decoder/README.md +0 -265
  341. package/node_modules/audio-decode/node_modules/opus-decoder/dist/opus-decoder.min.js +0 -232
  342. package/node_modules/audio-decode/node_modules/opus-decoder/dist/opus-decoder.min.js.map +0 -1
  343. package/node_modules/audio-decode/node_modules/opus-decoder/index.js +0 -8
  344. package/node_modules/audio-decode/node_modules/opus-decoder/package.json +0 -56
  345. package/node_modules/audio-decode/node_modules/opus-decoder/src/EmscriptenWasm.js +0 -0
  346. package/node_modules/audio-decode/node_modules/opus-decoder/src/OpusDecoder.js +0 -239
  347. package/node_modules/audio-decode/node_modules/opus-decoder/src/OpusDecoderWebWorker.js +0 -17
  348. package/node_modules/audio-decode/node_modules/opus-decoder/types.d.ts +0 -74
  349. package/node_modules/audio-decode/readme.md +0 -49
  350. package/node_modules/audio-decode/tea.yaml +0 -6
  351. package/node_modules/audio-decode/test-case.js +0 -11
  352. package/node_modules/audio-decode/test.html +0 -15
  353. package/node_modules/audio-decode/test.js +0 -107
  354. /package/node_modules/typebox/build/guard/{string.d.mts → unicode/unicode_segment.d.mts} +0 -0
@@ -0,0 +1,80 @@
1
+ # @audio/decode-aac
2
+
3
+ Decode AAC/M4A and ALAC audio to PCM float samples. FAAD2 WASM handles AAC; a pure-JS port of Apple's reference decoder handles ALAC. The M4A sample entry selects the codec.
4
+
5
+ ## Install
6
+
7
+ ```
8
+ npm i @audio/decode-aac
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```js
14
+ import decode from '@audio/decode-aac'
15
+
16
+ // M4A or raw ADTS; auto-detected
17
+ let { channelData, sampleRate } = await decode(uint8array)
18
+ // channelData: Float32Array[] (one per channel)
19
+ // sampleRate: number
20
+ ```
21
+
22
+ ### Streaming
23
+
24
+ ```js
25
+ import { decoder } from '@audio/decode-aac'
26
+
27
+ let dec = await decoder()
28
+ let { channelData, sampleRate } = dec.decode(chunk)
29
+ dec.free()
30
+ ```
31
+
32
+ `decoder()` is asynchronous. Its `decode()` and `flush()` methods are synchronous.
33
+
34
+ ## API
35
+
36
+ ### `decode(src: Uint8Array | ArrayBuffer): Promise<AudioData>`
37
+
38
+ Whole-file decode. Auto-detects M4A (MP4 container) vs raw ADTS.
39
+
40
+ ### `decoder(opts?): Promise<AACDecoder>`
41
+
42
+ Creates a decoder instance for manual control.
43
+
44
+ - `dec.decode(data)`: decode a `Uint8Array` or `ArrayBuffer` chunk.
45
+ - `dec.flush()`: discard buffered partial data and return an empty result.
46
+ - `dec.free()`: release WASM memory.
47
+
48
+ Without options the byte stream is auto-detected (M4A or ADTS). Container demuxers that hold the codec config out-of-band pass it up-front and feed raw access units — one frame, or an array of frames, per `decode()` call:
49
+
50
+ ```js
51
+ let dec = await decoder({ asc }) // AudioSpecificConfig (esds, Matroska CodecPrivate, WAVEFORMATEX extra bytes)
52
+ let dec = await decoder({ alac }) // ALAC magic cookie
53
+ ```
54
+
55
+ This is how [@audio/decode-mp4](../decode-mp4), [@audio/decode-webm](../decode-webm) and [@audio/decode-avi](../decode-avi) decode AAC and ALAC tracks from video files.
56
+
57
+ ### `AudioData`
58
+
59
+ ```ts
60
+ { channelData: Float32Array[], sampleRate: number }
61
+ ```
62
+
63
+ ## Formats
64
+
65
+ - M4A / MP4 / MOV with AAC audio (LC and HE-AAC v1/v2 with SBR or PS) — QuickTime sound descriptions v0, v1 and v2
66
+ - M4A / MP4 with bit-exact pure-JS ALAC decoding at 16, 20, 24, or 32 bits
67
+ - Raw ADTS streams (.aac)
68
+
69
+ ## Metadata
70
+
71
+ ```js
72
+ import { parseMeta } from '@audio/decode-aac/meta'
73
+
74
+ let { meta, sampleRate } = parseMeta(m4aBytes)
75
+ // meta: { title, artist, album, year, genre, track, ..., pictures }
76
+ ```
77
+
78
+ ## License
79
+
80
+ [ॐ](https://github.com/krishnized/license/) · AAC decoding [GPL-2.0](./LICENSE) (FAAD2), ALAC decoding Apache-2.0 (port of Apple's ALAC reference)
@@ -0,0 +1,326 @@
1
+ /**
2
+ * ALAC (Apple Lossless) decoder — pure JS.
3
+ * Ported from Apple's ALAC reference decoder (Apache License 2.0):
4
+ * ALACDecoder.cpp, ag_dec.c, dp_dec.c, matrix_dec.c, ALACBitUtilities.c
5
+ * Copyright (c) 2011 Apple Inc. https://github.com/macosforge/alac
6
+ *
7
+ * createALAC(cookie) → { config, decodeFrame(frameBytes) → { channelData: Float32Array[], numSamples } }
8
+ */
9
+
10
+ // ── constants (aglib.h) ──────────────────────────────────────────────
11
+ const QBSHIFT = 9, QB = 1 << QBSHIFT
12
+ const MMULSHIFT = 2, MDENSHIFT = QBSHIFT - MMULSHIFT - 1, MOFF = 1 << (MDENSHIFT - 2)
13
+ const BITOFF = 24
14
+ const MAX_PREFIX_16 = 9, MAX_PREFIX_32 = 9, MAX_DATATYPE_BITS_16 = 16
15
+ const N_MAX_MEAN_CLAMP = 0xffff, N_MEAN_CLAMP_VAL = 0xffff
16
+ // MPEG element ids (ALACBitUtilities.h)
17
+ const ID_SCE = 0, ID_CPE = 1, ID_LFE = 3, ID_DSE = 4, ID_FIL = 6, ID_END = 7
18
+
19
+ // ── bit reader (ALACBitUtilities.c) ──────────────────────────────────
20
+ // pos = absolute bit index into data; data is padded with 8 trailing zeros so
21
+ // 32-bit window reads near the end are always in-bounds.
22
+ function bits(data, realLen) { return { data, pos: 0, realLen } }
23
+ function read(bb, n) { // BitBufferRead — up to 16 bits, MSB first
24
+ let p = bb.pos, o = p >> 3, d = bb.data
25
+ let v = (((d[o] << 16) | (d[o + 1] << 8) | d[o + 2]) << (p & 7)) & 0xFFFFFF
26
+ bb.pos = p + n
27
+ return v >>> (24 - n)
28
+ }
29
+ function readOne(bb) { let p = bb.pos; bb.pos = p + 1; return (bb.data[p >> 3] >> (7 - (p & 7))) & 1 }
30
+ function byteAlign(bb) { bb.pos = (bb.pos + 7) & ~7 }
31
+ function read32(d, o) { return (((d[o] << 24) | (d[o + 1] << 16) | (d[o + 2] << 8) | d[o + 3]) >>> 0) }
32
+
33
+ function getstreambits(d, bitoffset, numbits) {
34
+ let byteoffset = bitoffset >>> 3
35
+ let load1 = read32(d, byteoffset), result
36
+ if ((numbits + (bitoffset & 7)) > 32) {
37
+ result = (load1 << (bitoffset & 7)) >>> 0
38
+ let load2 = d[byteoffset + 4]
39
+ load2 = load2 >>> (8 - (numbits + (bitoffset & 7) - 32))
40
+ result = result >>> (32 - numbits)
41
+ result = (result | load2) >>> 0
42
+ } else {
43
+ result = load1 >>> (32 - numbits - (bitoffset & 7))
44
+ }
45
+ if (numbits !== 32) result = (result & (((1 << numbits) >>> 0) - 1)) >>> 0
46
+ return result >>> 0
47
+ }
48
+
49
+ // ── adaptive Golomb decode (ag_dec.c) ────────────────────────────────
50
+ function lg3a(x) { return 31 - Math.clz32(x + 3) }
51
+
52
+ // st = { p } carries the local bit position
53
+ function dynGet32(d, st, m, k, maxbits) {
54
+ let tempbits = st.p
55
+ let streamlong = (read32(d, tempbits >> 3) << (tempbits & 7)) >>> 0
56
+ let result = Math.clz32((~streamlong) >>> 0)
57
+ if (result >= MAX_PREFIX_32) {
58
+ result = getstreambits(d, tempbits + MAX_PREFIX_32, maxbits)
59
+ tempbits += MAX_PREFIX_32 + maxbits
60
+ } else {
61
+ tempbits += result + 1
62
+ if (k !== 1) {
63
+ streamlong = (streamlong << (result + 1)) >>> 0
64
+ let v = streamlong >>> (32 - k)
65
+ tempbits += k - 1
66
+ result = Math.imul(result, m)
67
+ if (v >= 2) { result += v - 1; tempbits += 1 }
68
+ }
69
+ }
70
+ st.p = tempbits
71
+ return result
72
+ }
73
+
74
+ function dynGet(d, st, m, k) {
75
+ let tempbits = st.p
76
+ let streamlong = (read32(d, tempbits >> 3) << (tempbits & 7)) >>> 0
77
+ let pre = Math.clz32((~streamlong) >>> 0), result
78
+ if (pre >= MAX_PREFIX_16) {
79
+ pre = MAX_PREFIX_16
80
+ tempbits += pre
81
+ streamlong = (streamlong << pre) >>> 0
82
+ result = streamlong >>> (32 - MAX_DATATYPE_BITS_16)
83
+ tempbits += MAX_DATATYPE_BITS_16
84
+ } else {
85
+ tempbits += pre + 1
86
+ streamlong = (streamlong << (pre + 1)) >>> 0
87
+ let v = streamlong >>> (32 - k)
88
+ tempbits += k
89
+ result = Math.imul(pre, m) + v - 1
90
+ if (v < 2) { result -= (v - 1); tempbits -= 1 }
91
+ }
92
+ st.p = tempbits
93
+ return result
94
+ }
95
+
96
+ // fills pc[0..numSamples) with residuals; advances bb.pos
97
+ function dynDecomp(p, bb, pc, numSamples, maxSize) {
98
+ let d = bb.data, st = { p: bb.pos }, maxPos = bb.realLen * 8
99
+ let mb = p.mb0, pb = p.pb, kb = p.kb, wb = p.wb
100
+ let zmode = 0, c = 0, o = 0
101
+ while (c < numSamples) {
102
+ if (st.p >= maxPos) throw Error('ALAC: ran past frame')
103
+ let m = mb >>> QBSHIFT
104
+ let k = Math.min(lg3a(m), kb)
105
+ m = (1 << k) - 1
106
+ let n = dynGet32(d, st, m, k, maxSize)
107
+ let ndecode = n + zmode
108
+ let mult = (-(ndecode & 1)) | 1
109
+ pc[o++] = ((ndecode + 1) >> 1) * mult
110
+ c++
111
+ mb = pb * (n + zmode) + mb - ((pb * mb) >> QBSHIFT)
112
+ if (n > N_MAX_MEAN_CLAMP) mb = N_MEAN_CLAMP_VAL
113
+ zmode = 0
114
+ if (((mb << MMULSHIFT) < QB) && (c < numSamples)) {
115
+ zmode = 1
116
+ k = Math.clz32(mb) - BITOFF + ((mb + MOFF) >> MDENSHIFT)
117
+ let mz = ((1 << k) - 1) & wb
118
+ n = dynGet(d, st, mz, k)
119
+ if (c + n > numSamples) throw Error('ALAC: zero-run overflow')
120
+ for (let j = 0; j < n; j++) { pc[o++] = 0; c++ }
121
+ if (n >= 65535) zmode = 0
122
+ mb = 0
123
+ }
124
+ }
125
+ bb.pos = st.p
126
+ }
127
+
128
+ // ── dynamic predictor (dp_dec.c) ─────────────────────────────────────
129
+ function signOf(i) { return (((-i) >>> 31) | (i >> 31)) }
130
+
131
+ function unpcBlock(pc1, out, num, coefs, numactive, chanbits, denshift) {
132
+ let chanshift = 32 - chanbits, denhalf = 1 << (denshift - 1)
133
+ out[0] = pc1[0]
134
+ if (numactive === 0) { for (let i = 1; i < num; i++) out[i] = pc1[i]; return }
135
+ if (numactive === 31) {
136
+ let prev = out[0]
137
+ for (let j = 1; j < num; j++) { let del = pc1[j] + prev; prev = (del << chanshift) >> chanshift; out[j] = prev }
138
+ return
139
+ }
140
+ for (let j = 1; j <= numactive; j++) { let del = pc1[j] + out[j - 1]; out[j] = (del << chanshift) >> chanshift }
141
+ let lim = numactive + 1
142
+ for (let j = lim; j < num; j++) {
143
+ let sum1 = 0, pb = j - 1, top = out[j - lim]
144
+ for (let kk = 0; kk < numactive; kk++) sum1 = (sum1 + Math.imul(coefs[kk], out[pb - kk] - top)) | 0
145
+ let del = pc1[j], del0 = del, sg = signOf(del)
146
+ del = (del + top + ((sum1 + denhalf) >> denshift)) | 0
147
+ out[j] = (del << chanshift) >> chanshift
148
+ if (sg > 0) {
149
+ for (let kk = numactive - 1; kk >= 0; kk--) {
150
+ let dd = top - out[pb - kk], sgn = signOf(dd)
151
+ coefs[kk] -= sgn
152
+ del0 -= Math.imul(numactive - kk, (Math.imul(sgn, dd) >> denshift))
153
+ if (del0 <= 0) break
154
+ }
155
+ } else if (sg < 0) {
156
+ for (let kk = numactive - 1; kk >= 0; kk--) {
157
+ let dd = top - out[pb - kk], sgn = signOf(dd)
158
+ coefs[kk] += sgn
159
+ del0 -= Math.imul(numactive - kk, (Math.imul(-sgn, dd) >> denshift))
160
+ if (del0 >= 0) break
161
+ }
162
+ }
163
+ }
164
+ }
165
+
166
+ // ── magic cookie (ALACSpecificConfig) ────────────────────────────────
167
+ function parseConfig(c) {
168
+ let u32 = (o) => (c[o] * 0x1000000) + (c[o + 1] << 16) + (c[o + 2] << 8) + c[o + 3]
169
+ return {
170
+ frameLength: u32(0), bitDepth: c[5], pb: c[6], mb: c[7], kb: c[8],
171
+ numChannels: c[9], maxRun: (c[10] << 8) | c[11],
172
+ sampleRate: u32(20),
173
+ }
174
+ }
175
+
176
+ export function createALAC(cookie) {
177
+ let cfg = parseConfig(cookie)
178
+ let N = cfg.frameLength
179
+ let mixU = new Int32Array(N), mixV = new Int32Array(N), pred = new Int32Array(N)
180
+ let shiftBuf = new Int32Array(N * 2)
181
+ let scale = 1 / Math.pow(2, cfg.bitDepth - 1)
182
+
183
+ function agParams(pbFactor) {
184
+ let pb = ((cfg.pb * pbFactor) / 4) | 0
185
+ return { mb0: cfg.mb, pb, kb: cfg.kb, wb: (1 << cfg.kb) - 1 }
186
+ }
187
+
188
+ // decode one ALAC frame → per-channel Int32 samples; returns numSamples
189
+ function decodeElements(bb, chans, requested) {
190
+ let chanIndex = 0, numSamples = requested
191
+ while (true) {
192
+ if (bb.pos >> 3 >= bb.realLen) break
193
+ let tag = read(bb, 3)
194
+ if (tag === ID_SCE || tag === ID_LFE) {
195
+ read(bb, 4) // element instance tag
196
+ if (read(bb, 12) !== 0) throw Error('ALAC: bad header')
197
+ let hb = read(bb, 4)
198
+ let partial = hb >> 3, bytesShifted = (hb >> 1) & 3, escape = hb & 1
199
+ if (bytesShifted === 3) throw Error('ALAC: bad shift')
200
+ let shift = bytesShifted * 8
201
+ let chanBits = cfg.bitDepth - shift
202
+ if (partial) numSamples = ((read(bb, 16) << 16) | read(bb, 16)) >>> 0
203
+ if (!escape) {
204
+ read(bb, 8); read(bb, 8) // mixBits, mixRes (unused for mono)
205
+ let hu = read(bb, 8), modeU = hu >> 4, denShiftU = hu & 0xf
206
+ let pu = read(bb, 8), pbFactorU = pu >> 5, numU = pu & 0x1f
207
+ let coefsU = new Int16Array(32)
208
+ for (let i = 0; i < numU; i++) coefsU[i] = read(bb, 16)
209
+ let shiftPos = bb.pos
210
+ if (bytesShifted) bb.pos += shift * numSamples
211
+ dynDecomp(agParams(pbFactorU), bb, pred, numSamples, chanBits)
212
+ if (modeU === 0) unpcBlock(pred, mixU, numSamples, coefsU, numU, chanBits, denShiftU)
213
+ else { unpcBlock(pred, pred, numSamples, null, 31, chanBits, 0); unpcBlock(pred, mixU, numSamples, coefsU, numU, chanBits, denShiftU) }
214
+ readShift(bb, shiftPos, shift, numSamples, 1)
215
+ } else {
216
+ let s = 32 - chanBits
217
+ if (chanBits <= 16) {
218
+ for (let i = 0; i < numSamples; i++) mixU[i] = (read(bb, chanBits) << s) >> s
219
+ } else {
220
+ let extra = chanBits - 16
221
+ for (let i = 0; i < numSamples; i++) { let v = (read(bb, 16) << 16) >> s; mixU[i] = v | read(bb, extra) }
222
+ }
223
+ bytesShifted = 0
224
+ }
225
+ let out = new Int32Array(numSamples)
226
+ for (let i = 0; i < numSamples; i++) out[i] = bytesShifted ? ((mixU[i] << shift) | shiftBuf[i]) : mixU[i]
227
+ chans[chanIndex++] = out
228
+ } else if (tag === ID_CPE) {
229
+ read(bb, 4)
230
+ if (read(bb, 12) !== 0) throw Error('ALAC: bad header')
231
+ let hb = read(bb, 4)
232
+ let partial = hb >> 3, bytesShifted = (hb >> 1) & 3, escape = hb & 1
233
+ if (bytesShifted === 3) throw Error('ALAC: bad shift')
234
+ let shift = bytesShifted * 8
235
+ let chanBits = cfg.bitDepth - shift + 1
236
+ if (partial) numSamples = ((read(bb, 16) << 16) | read(bb, 16)) >>> 0
237
+ let mixBits = 0, mixRes = 0
238
+ if (!escape) {
239
+ mixBits = read(bb, 8); mixRes = (read(bb, 8) << 24) >> 24 // int8
240
+ let hu = read(bb, 8), modeU = hu >> 4, denShiftU = hu & 0xf
241
+ let pu = read(bb, 8), pbFactorU = pu >> 5, numU = pu & 0x1f
242
+ let coefsU = new Int16Array(32)
243
+ for (let i = 0; i < numU; i++) coefsU[i] = read(bb, 16)
244
+ let hv = read(bb, 8), modeV = hv >> 4, denShiftV = hv & 0xf
245
+ let pv = read(bb, 8), pbFactorV = pv >> 5, numV = pv & 0x1f
246
+ let coefsV = new Int16Array(32)
247
+ for (let i = 0; i < numV; i++) coefsV[i] = read(bb, 16)
248
+ let shiftPos = bb.pos
249
+ if (bytesShifted) bb.pos += shift * 2 * numSamples
250
+ dynDecomp(agParams(pbFactorU), bb, pred, numSamples, chanBits)
251
+ if (modeU === 0) unpcBlock(pred, mixU, numSamples, coefsU, numU, chanBits, denShiftU)
252
+ else { unpcBlock(pred, pred, numSamples, null, 31, chanBits, 0); unpcBlock(pred, mixU, numSamples, coefsU, numU, chanBits, denShiftU) }
253
+ dynDecomp(agParams(pbFactorV), bb, pred, numSamples, chanBits)
254
+ if (modeV === 0) unpcBlock(pred, mixV, numSamples, coefsV, numV, chanBits, denShiftV)
255
+ else { unpcBlock(pred, pred, numSamples, null, 31, chanBits, 0); unpcBlock(pred, mixV, numSamples, coefsV, numV, chanBits, denShiftV) }
256
+ readShift(bb, shiftPos, shift, numSamples, 2)
257
+ } else {
258
+ chanBits = cfg.bitDepth
259
+ let s = 32 - chanBits
260
+ if (chanBits <= 16) {
261
+ for (let i = 0; i < numSamples; i++) {
262
+ mixU[i] = (read(bb, chanBits) << s) >> s
263
+ mixV[i] = (read(bb, chanBits) << s) >> s
264
+ }
265
+ } else {
266
+ let extra = chanBits - 16
267
+ for (let i = 0; i < numSamples; i++) {
268
+ let v = (read(bb, 16) << 16) >> s; mixU[i] = v | read(bb, extra)
269
+ let w = (read(bb, 16) << 16) >> s; mixV[i] = w | read(bb, extra)
270
+ }
271
+ }
272
+ bytesShifted = 0
273
+ }
274
+ // un-mix
275
+ let l = new Int32Array(numSamples), r = new Int32Array(numSamples)
276
+ for (let j = 0; j < numSamples; j++) {
277
+ let a, b
278
+ if (mixRes !== 0) { a = mixU[j] + mixV[j] - ((mixRes * mixV[j]) >> mixBits); b = a - mixV[j] }
279
+ else { a = mixU[j]; b = mixV[j] }
280
+ if (bytesShifted) { a = (a << shift) | shiftBuf[2 * j]; b = (b << shift) | shiftBuf[2 * j + 1] }
281
+ l[j] = a; r[j] = b
282
+ }
283
+ chans[chanIndex++] = l; chans[chanIndex++] = r
284
+ } else if (tag === ID_DSE) { skipDSE(bb) }
285
+ else if (tag === ID_FIL) { skipFIL(bb) }
286
+ else if (tag === ID_END) { byteAlign(bb); break }
287
+ else throw Error('ALAC: unsupported element ' + tag)
288
+ if (chanIndex >= chans.length) break
289
+ }
290
+ return numSamples
291
+ }
292
+
293
+ function readShift(bb, shiftPos, shift, numSamples, nch) {
294
+ if (!shift) return
295
+ let sb = { data: bb.data, pos: shiftPos, realLen: bb.realLen }
296
+ let count = numSamples * nch
297
+ for (let i = 0; i < count; i++) shiftBuf[i] = read(sb, shift)
298
+ }
299
+
300
+ function skipFIL(bb) { let count = read(bb, 4); if (count === 15) count += read(bb, 8) - 1; bb.pos += count * 8 }
301
+ function skipDSE(bb) {
302
+ read(bb, 4); let align = readOne(bb)
303
+ let count = read(bb, 8); if (count === 255) count += read(bb, 8)
304
+ if (align) byteAlign(bb)
305
+ bb.pos += count * 8
306
+ }
307
+
308
+ return {
309
+ config: cfg,
310
+ decodeFrame(frame) {
311
+ let data = new Uint8Array(frame.length + 8)
312
+ data.set(frame)
313
+ let bb = bits(data, frame.length)
314
+ let chans = new Array(cfg.numChannels)
315
+ let numSamples = decodeElements(bb, chans, cfg.frameLength)
316
+ let channelData = []
317
+ for (let c = 0; c < cfg.numChannels; c++) {
318
+ let src = chans[c] || new Int32Array(numSamples)
319
+ let f = new Float32Array(numSamples)
320
+ for (let i = 0; i < numSamples; i++) f[i] = src[i] * scale
321
+ channelData.push(f)
322
+ }
323
+ return { channelData, numSamples }
324
+ },
325
+ }
326
+ }
@@ -0,0 +1,15 @@
1
+ // Generated from the audio.js manifest (params metadata is the source of truth).
2
+ // Regenerate: node tools/dts.js in @audio/compile. Do not edit by hand.
3
+
4
+ /** Automatable number — scalar, `t => value` fn, or breakpoint curve {t, v} */
5
+ type Auto = number | ((t: number) => number) | { t: number[], v: number[] }
6
+ /** Per-block param values as delivered by hosts (numbers arrive as 1-length Float32Array) */
7
+ type Live = Record<string, Float32Array | string | boolean>
8
+ type Ctx = { sampleRate: number, maxBlockSize: number, maxChannels: number, currentTime: number, duration?: number, events?: readonly any[], emit?: (name: string, ...args: any[]) => void, [k: string]: unknown }
9
+ type Process = (inputs: Float32Array[][], outputs: Float32Array[][], params: Live) => void
10
+
11
+ /** Codec plugin 'aac' — extends audio()'s openable formats / save() targets */
12
+ export declare const aac: {
13
+ codec: 'aac'
14
+ decode(bytes: Uint8Array): { channelData: Float32Array[], sampleRate: number } | Promise<{ channelData: Float32Array[], sampleRate: number }>
15
+ }
@@ -0,0 +1,10 @@
1
+ // audio.js manifest — codec atom, decode half: whole-buffer bytes → { channelData,
2
+ // sampleRate }. Hosts merge with the encode half (@audio/encode-aac) by format
3
+ // name. Format detection is magic-byte (audio-type) — no test() needed here.
4
+
5
+ import decodeFn from './decode-aac.js'
6
+
7
+ export const aac = {
8
+ codec: 'aac',
9
+ decode: (bytes) => decodeFn(bytes),
10
+ }
@@ -0,0 +1,24 @@
1
+ export interface AudioData {
2
+ channelData: Float32Array[];
3
+ sampleRate: number;
4
+ }
5
+
6
+ interface AACDecoder {
7
+ /** Byte stream (M4A/ADTS), or with `asc`/`alac` options: one raw access unit or an array of them */
8
+ decode(data: Uint8Array | ArrayBuffer | Uint8Array[]): AudioData;
9
+ flush(): AudioData;
10
+ free(): void;
11
+ }
12
+
13
+ /** Whole-file decode — auto-detects M4A vs ADTS */
14
+ export default function decode(src: ArrayBuffer | Uint8Array): Promise<AudioData>;
15
+
16
+ export interface RawOptions {
17
+ /** AudioSpecificConfig — decode raw AAC access units from a container demuxer */
18
+ asc?: Uint8Array;
19
+ /** ALAC magic cookie (24-byte ALACSpecificConfig, `alac` box body, or full atom) — decode raw ALAC frames */
20
+ alac?: Uint8Array;
21
+ }
22
+
23
+ /** Create streaming decoder instance. Auto-detects M4A vs ADTS, or decodes raw frames when a config is given. */
24
+ export function decoder(opts?: RawOptions): Promise<AACDecoder>;