hyperframes 0.8.212 → 0.8.214

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 (187) hide show
  1. package/dist/{add-JSM7YBQX.js → add-U2N4ZWNB.js} +12 -12
  2. package/dist/{agentPromptGenerator-NTPYCKOI.js → agentPromptGenerator-EK7NEFV6.js} +7 -7
  3. package/dist/{animatedGifPrep-XTK7UWXF.js → animatedGifPrep-X3FLFGCC.js} +7 -7
  4. package/dist/api.js +17 -17
  5. package/dist/{asset-SMY2EGPH.js → asset-3CSXQ7JI.js} +2 -2
  6. package/dist/{assetCataloger-CVPWY34W.js → assetCataloger-FG2VTSSR.js} +8 -8
  7. package/dist/{audio-Y4OYLTWN.js → audio-US7IUDFM.js} +309 -204
  8. package/dist/{auth-MDEHZR7R.js → auth-IMXNGPGR.js} +1 -1
  9. package/dist/{autoUpdate-3FL6EDPM.js → autoUpdate-IGZP5HIX.js} +2 -2
  10. package/dist/{backgroundChecks-A6TG2BT3.js → backgroundChecks-UGU6SRCU.js} +3 -3
  11. package/dist/backgroundChecksWorker.js +3 -3
  12. package/dist/{batchRender-K2PBRRTQ.js → batchRender-5JS4SAGR.js} +4 -4
  13. package/dist/{beats-RA6XK6J5.js → beats-2F7ZW7QB.js} +10 -10
  14. package/dist/{benchmark-EHU5O4PP.js → benchmark-Y25FBDO7.js} +9 -9
  15. package/dist/{browser-7RUIZT2H.js → browser-43AS35ZL.js} +3 -3
  16. package/dist/{bundleWithLocalizedFonts-O2U2FYY2.js → bundleWithLocalizedFonts-6VHTVRO3.js} +2 -2
  17. package/dist/{capture-77KDKKNK.js → capture-CMP4DHPY.js} +46 -17
  18. package/dist/{capture-JGYBORAG.js → capture-N5AMWY4S.js} +4 -4
  19. package/dist/{captureCompositionFrame-DZ7EHPZV.js → captureCompositionFrame-PQT4GNR2.js} +12 -12
  20. package/dist/{catalog-CUP3SYAI.js → catalog-SZPWUZ75.js} +12 -12
  21. package/dist/{catch-up-ZGUCWH5Q.js → catch-up-OYYHR2UB.js} +4 -4
  22. package/dist/{check-ITGFVBT6.js → check-MBW4AYV6.js} +38 -38
  23. package/dist/{checkAudio-CTLPD6YT.js → checkAudio-DIJNBWAF.js} +28 -13
  24. package/dist/{checkBrowser-G2N4JI6N.js → checkBrowser-NYBDUAT2.js} +32 -32
  25. package/dist/{chunk-VKD23SIO.js → chunk-245CC6JT.js} +1 -1
  26. package/dist/{chunk-UE4CXHMF.js → chunk-3AAAA3KH.js} +3 -3
  27. package/dist/{chunk-3JQ2YOKL.js → chunk-3ZNAP65U.js} +1 -1
  28. package/dist/{chunk-QUXWS5UG.js → chunk-4HMG5CQJ.js} +13 -6
  29. package/dist/{chunk-GVE6I5EL.js → chunk-4NJ57TSE.js} +13 -1
  30. package/dist/{chunk-RDZKBIEB.js → chunk-53ERMOK2.js} +2 -2
  31. package/dist/{chunk-YRO3PXWU.js → chunk-6CGYINE7.js} +97 -2
  32. package/dist/{chunk-V6OSE6VT.js → chunk-6UUPTWUG.js} +1 -1
  33. package/dist/{chunk-YVT5IU6J.js → chunk-7W4DJKZA.js} +9 -9
  34. package/dist/{chunk-DXPC7Z6L.js → chunk-7Y4TTOLE.js} +2 -2
  35. package/dist/{chunk-TPO32Z65.js → chunk-7YUYG6S6.js} +1 -1
  36. package/dist/{chunk-UXH6E5HC.js → chunk-A3ZRV44X.js} +2 -2
  37. package/dist/{chunk-P2VGMOX7.js → chunk-A7UJGIMA.js} +1 -1
  38. package/dist/{chunk-25MKZTRT.js → chunk-BRTWBGFE.js} +1 -1
  39. package/dist/{chunk-WVIH5BBZ.js → chunk-CATLCEDQ.js} +14 -14
  40. package/dist/{chunk-YACECUHX.js → chunk-DFQM3XMK.js} +3 -3
  41. package/dist/{chunk-2YDIEZSF.js → chunk-EJCCJTUH.js} +3 -3
  42. package/dist/{chunk-MX2GMAAW.js → chunk-ENV35BSH.js} +35 -24
  43. package/dist/chunk-FBQVRYMD.js +5061 -0
  44. package/dist/{chunk-7ZAVTGGT.js → chunk-FC6BAQV5.js} +9 -9
  45. package/dist/{chunk-EC77ZBCP.js → chunk-FI3JWR34.js} +1 -1
  46. package/dist/{chunk-UBUKKTNW.js → chunk-FQO3RV6O.js} +2 -2
  47. package/dist/{chunk-YX5ELTKV.js → chunk-G7CFMNRO.js} +2 -2
  48. package/dist/{chunk-BYRXSKIY.js → chunk-GFA5ZCVI.js} +332 -3
  49. package/dist/{chunk-W55BW7KA.js → chunk-GRCS7WRH.js} +10 -10
  50. package/dist/{chunk-RJILJ4OR.js → chunk-GSYZG4E7.js} +2 -2
  51. package/dist/{chunk-DVVTBVKA.js → chunk-GVHEOOGM.js} +8 -8
  52. package/dist/{chunk-J7GPSY5N.js → chunk-HNYTTRLR.js} +7 -7
  53. package/dist/{chunk-UYEZTK4U.js → chunk-HPTFD6MO.js} +10 -10
  54. package/dist/{chunk-T7KNW7PE.js → chunk-HQRI2NT3.js} +1 -1
  55. package/dist/{chunk-BLVHVXRU.js → chunk-HVQDDVN4.js} +3 -3
  56. package/dist/{chunk-N7XJHZ35.js → chunk-I5LDGNYX.js} +1 -1
  57. package/dist/{chunk-GQ724553.js → chunk-ISTUBRV3.js} +4 -4
  58. package/dist/{chunk-U46JEU26.js → chunk-JF3RF6GS.js} +4 -2
  59. package/dist/{chunk-Y3U7ECBH.js → chunk-JMSS47CW.js} +1 -1
  60. package/dist/{chunk-X4SBDDLS.js → chunk-KSC4O2RY.js} +4 -0
  61. package/dist/{chunk-W2VJTKIW.js → chunk-KSV2PMFA.js} +7 -7
  62. package/dist/{chunk-N3J2MLXC.js → chunk-LBS4AS7G.js} +2 -2
  63. package/dist/{chunk-OL5E4Y4L.js → chunk-LIOE46OG.js} +59 -27
  64. package/dist/{chunk-R5B6GXQM.js → chunk-LRYNDYAE.js} +1 -1
  65. package/dist/{chunk-5TQ4AEPF.js → chunk-LWWTOBZ6.js} +3 -3
  66. package/dist/{chunk-ORJY6Z6G.js → chunk-MGUA3DUS.js} +3 -3
  67. package/dist/{chunk-XEWMJWNW.js → chunk-MP7DZH5M.js} +2 -2
  68. package/dist/{chunk-XGXTZNES.js → chunk-MYDM4PQL.js} +3 -3
  69. package/dist/{chunk-RQC4PHO3.js → chunk-MZHYAXUV.js} +1 -1
  70. package/dist/{chunk-JLGVBK5M.js → chunk-N4XNRHFM.js} +18 -4
  71. package/dist/{chunk-NXDKBFEO.js → chunk-PT47MVXR.js} +13 -13
  72. package/dist/{chunk-SXTWQ7CH.js → chunk-QCCPXMKP.js} +5 -5
  73. package/dist/{chunk-MJCIAZSK.js → chunk-QL7ITOPE.js} +1 -1
  74. package/dist/{chunk-AJAXP4HF.js → chunk-S6WDNIUG.js} +1 -1
  75. package/dist/{chunk-3YBXKWAF.js → chunk-T6SMQ4L7.js} +1 -1
  76. package/dist/{chunk-JZNQQI5M.js → chunk-TNKPBI63.js} +5 -5
  77. package/dist/{chunk-ZCYSQ3NQ.js → chunk-TYMD647L.js} +3 -3
  78. package/dist/{chunk-HXZNCXQX.js → chunk-UBDO4EHA.js} +9 -0
  79. package/dist/{chunk-45JN2GIZ.js → chunk-UR6QODTY.js} +1 -1
  80. package/dist/{chunk-PW7FCVHR.js → chunk-URD4QIQS.js} +1 -1
  81. package/dist/{chunk-FW6CYA5D.js → chunk-VAOROEWU.js} +3 -3
  82. package/dist/{chunk-7W7ANGR4.js → chunk-VC6GEQ7P.js} +18 -18
  83. package/dist/{chunk-F5XADOGC.js → chunk-VEWR5HXT.js} +1 -1
  84. package/dist/{chunk-KZZWYIEB.js → chunk-VILE6GFD.js} +1 -1
  85. package/dist/{chunk-CODPTVC2.js → chunk-VW57BBGU.js} +1 -1
  86. package/dist/{chunk-CTZJSMGU.js → chunk-VZBJ5BQF.js} +1 -1
  87. package/dist/{chunk-DS7ANFBV.js → chunk-WJRYQYOM.js} +1 -1
  88. package/dist/{chunk-7Q5TBUC2.js → chunk-XESW4XN7.js} +2 -2
  89. package/dist/{chunk-A2WPZE2R.js → chunk-XM3NMXLX.js} +1 -1
  90. package/dist/{chunk-NGSENR4J.js → chunk-XWMY7FIW.js} +1 -1
  91. package/dist/{chunk-CCLBOLYU.js → chunk-YBNF5ZOC.js} +1 -1
  92. package/dist/{chunk-64XQS7AP.js → chunk-YDHXPY23.js} +1 -1
  93. package/dist/{chunk-6SG3RRAQ.js → chunk-YLEEVMBV.js} +2 -2
  94. package/dist/{chunk-UULZKCBI.js → chunk-YQCDSSIK.js} +1 -1
  95. package/dist/{chunk-SPDSRBIN.js → chunk-ZMKRQ4HE.js} +1 -1
  96. package/dist/{chunk-OSCWTA2O.js → chunk-ZXQNWUDY.js} +5 -5
  97. package/dist/{clean-FBZ7GHRY.js → clean-RDKZTFDC.js} +18 -18
  98. package/dist/cli.js +62 -59
  99. package/dist/{cloud-VYSWJ7UO.js → cloud-2MGM3NSJ.js} +4 -4
  100. package/dist/{cloudrun-U6LI7KLV.js → cloudrun-YQONSO6B.js} +5 -5
  101. package/dist/commands/layout-audit.browser.js +7 -10
  102. package/dist/{compare-YR7BMEHJ.js → compare-HAMCTSXR.js} +29 -29
  103. package/dist/{compiler-6YCAUK7Z.js → compiler-YUM2ODOP.js} +4 -4
  104. package/dist/{component-HVSM6FJV.js → component-2MDTLX6B.js} +3 -3
  105. package/dist/{compositions-QTFL2VNL.js → compositions-EEXADRKF.js} +11 -11
  106. package/dist/{delete-2FHCQ72T.js → delete-X4I63WKN.js} +2 -2
  107. package/dist/{deploy-6S45QWG6.js → deploy-BBGSS4I3.js} +1 -1
  108. package/dist/{deterministicFonts-LKAGUNE5.js → deterministicFonts-2ISM3LMW.js} +1 -1
  109. package/dist/{dist-NCI6JOJZ.js → dist-KXFW5H5Q.js} +4 -2
  110. package/dist/{dist-B4KLCLZ5.js → dist-ZE5X6MWG.js} +17 -3
  111. package/dist/{doctor-4MRS6RED.js → doctor-BNZ6D33R.js} +11 -11
  112. package/dist/{events-4VBBY7PP.js → events-6DI3CND6.js} +2 -2
  113. package/dist/{events-FN45HVPM.js → events-BYOF33UK.js} +5 -3
  114. package/dist/{feedback-T67P2CDA.js → feedback-Z3JOC7TX.js} +8 -8
  115. package/dist/{ffmpeg-ED7ZK6XH.js → ffmpeg-S44OTBCI.js} +7 -7
  116. package/dist/{figma-UXAWKPOY.js → figma-TVX2H5B3.js} +3 -3
  117. package/dist/fontLocalizeCli.js +11 -11
  118. package/dist/{get-EFH3PPJA.js → get-DWKTDVP7.js} +2 -2
  119. package/dist/{gpuPolicy-ZADQMXQT.js → gpuPolicy-GTBFSUHB.js} +7 -7
  120. package/dist/{grade-compare-425BFHSF.js → grade-compare-S4P6Z265.js} +30 -30
  121. package/dist/{heifImagePrep-ZJM7N2XY.js → heifImagePrep-RKQP2Y73.js} +8 -8
  122. package/dist/{help-23PPB2BD.js → help-WIC6DHOF.js} +1 -1
  123. package/dist/{history-CHJV33M5.js → history-UBRUPAHH.js} +6 -6
  124. package/dist/hyperframe.manifest.json +1 -1
  125. package/dist/hyperframe.runtime.iife.js +64 -64
  126. package/dist/hyperframes-player.global.js +1 -1
  127. package/dist/{info-36YPISVA.js → info-F5LTDQ6I.js} +8 -8
  128. package/dist/{init-U6EE2EIU.js → init-6L4WQKOD.js} +27 -27
  129. package/dist/{inspect-NI2RMUFR.js → inspect-DUIBB263.js} +30 -30
  130. package/dist/{installer-K3HIZ5CF.js → installer-JKZ5N47B.js} +5 -5
  131. package/dist/{keyframes-I6T2IT6I.js → keyframes-5FQNFJFE.js} +6 -6
  132. package/dist/{lambda-WL64Z2F3.js → lambda-YTO6N2QH.js} +11 -11
  133. package/dist/{layout-R2YZ4N6P.js → layout-H3F2LW62.js} +30 -30
  134. package/dist/{lint-IAAG6Z65.js → lint-WUWLVCJQ.js} +8 -8
  135. package/dist/{lintProject-EM7Y2ZRB.js → lintProject-SZIPPOJR.js} +2 -2
  136. package/dist/{list-3O6743DJ.js → list-3EFECRWU.js} +2 -2
  137. package/dist/{localPage-L5FRBCNP.js → localPage-C3267GRQ.js} +7 -7
  138. package/dist/{login-27TRFTYB.js → login-W5L64YRM.js} +4 -4
  139. package/dist/{manager-D6TE4ENP.js → manager-46MZB3HK.js} +8 -8
  140. package/dist/{media-treatment-E3YLZVXC.js → media-treatment-XBQWOU5U.js} +15 -15
  141. package/dist/{models-2Q3TGNH5.js → models-ZHNV44XV.js} +11 -11
  142. package/dist/{motionShot-XYW2HMVI.js → motionShot-DO4EQ2U3.js} +15 -15
  143. package/dist/{normalize-audio-D5WNUNDM.js → normalize-audio-2EXTDNBF.js} +10 -10
  144. package/dist/{open-3KO7UUPC.js → open-7ZOY3KI6.js} +12 -12
  145. package/dist/{parakeetRunner-WX6L6MW5.js → parakeetRunner-H3B4QP6W.js} +12 -12
  146. package/dist/{pipeline-WYIO4KGN.js → pipeline-7OKHNKGP.js} +10 -10
  147. package/dist/{play-ZM3ZUJSZ.js → play-B5NNOJN7.js} +21 -21
  148. package/dist/{preflight-7OMCIXNM.js → preflight-R26JZQJU.js} +8 -8
  149. package/dist/{present-E2PLH2GJ.js → present-Y2SEWKGO.js} +17 -17
  150. package/dist/{preview-TVRM75FN.js → preview-7CZX4A5T.js} +18 -18
  151. package/dist/{producer-M5F6KZEF.js → producer-WTO6XYGU.js} +1 -1
  152. package/dist/{projectConfig-VFKGY3XE.js → projectConfig-SJ5NIYUO.js} +7 -7
  153. package/dist/{publication-AF33R7LF.js → publication-47KNSXP7.js} +3 -3
  154. package/dist/{publish-Z7HGDQ5R.js → publish-4J4EKKQN.js} +11 -11
  155. package/dist/{remove-background-PN3KCBT4.js → remove-background-UKC6NKDH.js} +11 -11
  156. package/dist/{render-SEODWRRR.js → render-DBELH4AC.js} +15 -15
  157. package/dist/{render-IZNPEXMU.js → render-S2FJRE3H.js} +6 -6
  158. package/dist/{render-I3HBIJX3.js → render-TABKCTMF.js} +30 -30
  159. package/dist/{render-batch-MQSORY55.js → render-batch-6YJMWHZ4.js} +6 -6
  160. package/dist/renderSetupWorker.js +2 -2
  161. package/dist/{resolver-HXE4F2G4.js → resolver-EDI3JND5.js} +5 -5
  162. package/dist/{sherpa-NPT6S3RP.js → sherpa-R6HDRJCA.js} +11 -11
  163. package/dist/{skills-P3BI55YP.js → skills-2QIW3EOJ.js} +5 -5
  164. package/dist/{skillsUpdateCheck-43Q4ZHWN.js → skillsUpdateCheck-XG5FPCU5.js} +3 -3
  165. package/dist/{snapshot-YLT64YQS.js → snapshot-C5XBKYEF.js} +305 -90
  166. package/dist/{src-7S7K4QUN.js → src-CT2X45TD.js} +10 -10
  167. package/dist/{src-OHJ7USRX.js → src-E467QUBK.js} +10 -6
  168. package/dist/{staticProjectServer-RP3MW2EW.js → staticProjectServer-G54Z4BH7.js} +19 -19
  169. package/dist/studio/assets/{hyperframes-player-DHfuW7Lt.js → hyperframes-player-H1DIJsJZ.js} +1 -1
  170. package/dist/studio/assets/{index-CWgIsKzV.js → index-BftVE_0y.js} +119 -119
  171. package/dist/studio/assets/{index-CkjUY33q.js → index-v_hWj6Kv.js} +1 -1
  172. package/dist/studio/index.html +1 -1
  173. package/dist/{studio-api-BZPZCJL6.js → studio-api-O52RPXZC.js} +11 -11
  174. package/dist/{studioServer-QLRIXNYM.js → studioServer-WDTS6ZDI.js} +50 -50
  175. package/dist/{telemetry-QOBPRUWF.js → telemetry-GEHWCV7C.js} +3 -3
  176. package/dist/{timeline-OLQFVWVU.js → timeline-IVQDNGWZ.js} +19 -19
  177. package/dist/{tokens-BAHLVGEC.js → tokens-EN5PVV3Y.js} +2 -2
  178. package/dist/{transcribe-HR6BFDUR.js → transcribe-HKS3PZAF.js} +10 -10
  179. package/dist/{transcribe-3NHUWW4J.js → transcribe-NXMIBNLX.js} +16 -16
  180. package/dist/{updateCheck-BGHPCA7J.js → updateCheck-35TT5GRF.js} +2 -2
  181. package/dist/{upgrade-NFI6JOME.js → upgrade-G6EOHGUS.js} +2 -2
  182. package/dist/{urlDownloader-P35K74RS.js → urlDownloader-X7V63HCF.js} +6 -6
  183. package/dist/{validate-Q57ZCI4Q.js → validate-4JUCRS64.js} +24 -24
  184. package/dist/{video-OO2M2AKD.js → video-SWQXDG7J.js} +8 -8
  185. package/dist/warmCheck.js +38 -38
  186. package/package.json +1 -1
  187. package/dist/chunk-W5OBRMZ6.js +0 -4870
@@ -12,20 +12,22 @@ import {
12
12
  } from "./chunk-6A45RKAK.js";
13
13
  import {
14
14
  describeProject
15
- } from "./chunk-J7GPSY5N.js";
15
+ } from "./chunk-HNYTTRLR.js";
16
16
  import "./chunk-LLMSX6V6.js";
17
17
  import {
18
+ PITCH_RATE,
18
19
  bandFramesOf,
19
20
  envelope,
20
21
  loudness,
21
22
  medianInterval,
23
+ pitchTrack,
22
24
  rhythm,
23
25
  runLadder,
24
26
  signalDuration,
25
27
  signalProvider,
26
28
  snapper,
27
29
  tempoOf
28
- } from "./chunk-YRO3PXWU.js";
30
+ } from "./chunk-6CGYINE7.js";
29
31
  import {
30
32
  ensureDOMParser
31
33
  } from "./chunk-ZBAF6L74.js";
@@ -49,13 +51,13 @@ import {
49
51
  } from "./chunk-6MUI2H6P.js";
50
52
  import {
51
53
  resolveProject
52
- } from "./chunk-KZZWYIEB.js";
53
- import "./chunk-CTZJSMGU.js";
54
- import "./chunk-V6OSE6VT.js";
54
+ } from "./chunk-VILE6GFD.js";
55
+ import "./chunk-VZBJ5BQF.js";
56
+ import "./chunk-6UUPTWUG.js";
55
57
  import "./chunk-5ZBMHUY2.js";
56
58
  import "./chunk-A4ZTSQLW.js";
57
- import "./chunk-GVE6I5EL.js";
58
- import "./chunk-EC77ZBCP.js";
59
+ import "./chunk-4NJ57TSE.js";
60
+ import "./chunk-FI3JWR34.js";
59
61
  import "./chunk-EQGKUPBJ.js";
60
62
  import {
61
63
  assertKnownFlags
@@ -66,14 +68,14 @@ import {
66
68
  import "./chunk-S3S4TGEH.js";
67
69
  import "./chunk-54HJ63Q2.js";
68
70
  import "./chunk-2GICKZ3I.js";
69
- import "./chunk-OL5E4Y4L.js";
71
+ import "./chunk-LIOE46OG.js";
70
72
  import "./chunk-Z5J67X44.js";
71
73
  import "./chunk-5S7W3TUO.js";
72
74
  import "./chunk-D3MUHMFG.js";
73
- import "./chunk-QUXWS5UG.js";
75
+ import "./chunk-4HMG5CQJ.js";
74
76
  import "./chunk-YWRUQ7XZ.js";
75
- import "./chunk-BYRXSKIY.js";
76
- import "./chunk-W5OBRMZ6.js";
77
+ import "./chunk-GFA5ZCVI.js";
78
+ import "./chunk-FBQVRYMD.js";
77
79
  import "./chunk-VC76R6W2.js";
78
80
  import "./chunk-OFQWTKPW.js";
79
81
  import "./chunk-RQVDTPGD.js";
@@ -83,7 +85,7 @@ import "./chunk-FXMKHHPO.js";
83
85
  import "./chunk-5766TK7Q.js";
84
86
  import "./chunk-K4MJX7SR.js";
85
87
  import "./chunk-WE42NVH7.js";
86
- import "./chunk-U46JEU26.js";
88
+ import "./chunk-JF3RF6GS.js";
87
89
  import "./chunk-CZGHFATT.js";
88
90
  import {
89
91
  findFfBinary
@@ -91,7 +93,7 @@ import {
91
93
  import {
92
94
  resolveAuthoredAssetFile
93
95
  } from "./chunk-PBNWRWKA.js";
94
- import "./chunk-X4SBDDLS.js";
96
+ import "./chunk-KSC4O2RY.js";
95
97
  import "./chunk-NHA4NRBE.js";
96
98
  import "./chunk-FR7YBU3H.js";
97
99
  import "./chunk-DPVXBVLL.js";
@@ -102,7 +104,7 @@ import "./chunk-WC4MTXGN.js";
102
104
  import "./chunk-32NEJ553.js";
103
105
  import {
104
106
  withMeta
105
- } from "./chunk-NGSENR4J.js";
107
+ } from "./chunk-XWMY7FIW.js";
106
108
  import "./chunk-K4WIOZFP.js";
107
109
  import "./chunk-ZCHULPJZ.js";
108
110
  import "./chunk-ISN5GRYI.js";
@@ -111,7 +113,7 @@ import {
111
113
  CliUsageError
112
114
  } from "./chunk-DP5LF7GF.js";
113
115
  import "./chunk-J3RXEDR2.js";
114
- import "./chunk-UXH6E5HC.js";
116
+ import "./chunk-A3ZRV44X.js";
115
117
  import "./chunk-E63BDV4Z.js";
116
118
  import "./chunk-G7VEYUZ2.js";
117
119
  import "./chunk-XT6MXC7A.js";
@@ -119,7 +121,7 @@ import "./chunk-7KDQAD2W.js";
119
121
  import "./chunk-M2WBOQ2Q.js";
120
122
 
121
123
  // src/commands/audio.ts
122
- import { join as join7, resolve as resolve2 } from "path";
124
+ import { join as join8, resolve as resolve2 } from "path";
123
125
 
124
126
  // src/audio/analysis/providers/api.ts
125
127
  import { randomUUID } from "crypto";
@@ -798,6 +800,10 @@ function targetOf(projectDir, row, query) {
798
800
  window: {
799
801
  from: fileTime(placement, from),
800
802
  seconds: round4((to - from) * placement.playbackRate)
803
+ },
804
+ clip: {
805
+ from: placement.mediaStart,
806
+ seconds: round4((placement.end - placement.start) * placement.playbackRate)
801
807
  }
802
808
  };
803
809
  }
@@ -924,8 +930,83 @@ function formatReport(report) {
924
930
 
925
931
  // src/audio/analysis/run.ts
926
932
  import { existsSync as existsSync3 } from "fs";
933
+
934
+ // src/audio/analysis/kindCache.ts
935
+ import { createHash as createHash2, randomUUID as randomUUID2 } from "crypto";
936
+ import { mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
937
+ import { dirname as dirname2, join as join5 } from "path";
938
+ var CACHE_VERSION = 1;
939
+ var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
940
+ var finite = (value) => typeof value === "number" && Number.isFinite(value);
941
+ var probability = (value) => finite(value) && value >= 0 && value <= 1;
942
+ function isKindFeatures(value) {
943
+ return record(value) && finite(value.duration) && value.duration >= 0 && [value.regularity, value.syllables, value.sustain].every(probability) && (value.voiced === void 0 || probability(value.voiced));
944
+ }
945
+ function isKindGuess(value) {
946
+ return record(value) && typeof value.value === "string" && ["sfx", "music", "voice", "mixed"].includes(value.value) && probability(value.confidence) && isKindFeatures(value.features);
947
+ }
948
+ function kindSourceIdentity(path) {
949
+ const { size, mtimeMs, ctimeMs, ino } = statSync(path);
950
+ return JSON.stringify({ size, mtimeMs, ctimeMs, ino });
951
+ }
952
+ function kindCacheFile(dir, target, request, sampleRate, source = kindSourceIdentity(target.path)) {
953
+ const key = JSON.stringify({
954
+ version: CACHE_VERSION,
955
+ path: target.path,
956
+ source,
957
+ clip: target.clip,
958
+ sampleRate,
959
+ quality: request.quality,
960
+ provider: request.provider?.kind,
961
+ options: request.options?.kind
962
+ });
963
+ return join5(dir, `${createHash2("sha256").update(key).digest("hex")}.json`);
964
+ }
965
+ function readKindCache(file) {
966
+ if (file === null) return null;
967
+ let value;
968
+ try {
969
+ value = JSON.parse(readFileSync(file, "utf8"));
970
+ } catch {
971
+ return null;
972
+ }
973
+ if (!isKindGuess(value)) return null;
974
+ return {
975
+ analyzed: value.features.duration,
976
+ values: { kind: value },
977
+ provenance: { kind: "signal" },
978
+ ladder: { kind: [{ provider: "signal", outcome: "answered" }] },
979
+ warnings: []
980
+ };
981
+ }
982
+ function writeKindCache(file, value) {
983
+ const temporary = `${file}.${randomUUID2()}.tmp`;
984
+ try {
985
+ mkdirSync(dirname2(file), { recursive: true });
986
+ writeFileSync(temporary, JSON.stringify(value));
987
+ renameSync(temporary, file);
988
+ return null;
989
+ } catch {
990
+ return "kind could not be cached; another query will analyze the clip again";
991
+ } finally {
992
+ try {
993
+ rmSync(temporary, { force: true });
994
+ } catch {
995
+ }
996
+ }
997
+ }
998
+ function cacheKindAnalysis(file, analysis) {
999
+ if (analysis.provenance.kind !== "signal" || analysis.warnings.length || !isKindGuess(analysis.values.kind))
1000
+ return;
1001
+ const warning = writeKindCache(file, analysis.values.kind);
1002
+ if (warning) analysis.warnings.push(warning);
1003
+ }
1004
+
1005
+ // src/audio/analysis/run.ts
927
1006
  var round5 = (t) => Math.round(t * 1e3) / 1e3;
928
1007
  var EDGE_CONTEXT_SECONDS = 0.1;
1008
+ var KIND_SAMPLE_RATE = 16e3;
1009
+ var KIND_DECODE_BYTES = 256 * 1024 * 1024;
929
1010
  async function previewTarget(path, file, at, mediaStart = 0) {
930
1011
  if (at === null) return { path, file, ref: null, kind: "file", placement: null };
931
1012
  const stream = existsSync3(path) ? await probeAudio(path) : null;
@@ -999,16 +1080,81 @@ async function skippedPeak(target, kept, stream) {
999
1080
  `the loudest part of ${target.file} is in the first ${round5(skipped)} s, which is skipped`
1000
1081
  ];
1001
1082
  }
1002
- async function analyzeTarget(target, request, full) {
1083
+ function coversPart({ window, clip }) {
1084
+ return !!window && !!clip && (window.from > clip.from || window.from + window.seconds < clip.from + clip.seconds);
1085
+ }
1086
+ function clipKindRate(target, stream) {
1087
+ const seconds = Math.min(target.clip.seconds, Math.max(0, stream.duration - target.clip.from));
1088
+ const bytes = seconds * stream.sampleRate * stream.channels * 4;
1089
+ return bytes <= KIND_DECODE_BYTES ? stream.sampleRate : Math.min(stream.sampleRate, KIND_SAMPLE_RATE);
1090
+ }
1091
+ async function clipKindSignal(target, stream, sampleRate, windowSignal) {
1092
+ if (windowSignal) return windowSignal;
1093
+ const seconds = Math.min(target.clip.seconds, Math.max(0, stream.duration - target.clip.from));
1094
+ if (seconds * sampleRate * stream.channels * 4 > KIND_DECODE_BYTES)
1095
+ throw new Error("whole clip exceeds the kind analysis decode limit");
1096
+ return (await decodeAudio(target.path, target.clip, stream, { sampleRate }))?.signal;
1097
+ }
1098
+ async function clipKind(target, request, stream, cache, windowSignal) {
1099
+ const sampleRate = windowSignal ? stream.sampleRate : clipKindRate(target, stream);
1100
+ const file = cache ? kindCacheFile(cache.dir, target, request, sampleRate, cache.identity) : null;
1101
+ const cached = readKindCache(file);
1102
+ if (cached) return cached;
1103
+ const signal = await clipKindSignal(target, stream, sampleRate, windowSignal);
1104
+ if (!signal) return null;
1105
+ const analysis = await analyzeSignal(signal, {
1106
+ ...request,
1107
+ capabilities: ["kind"],
1108
+ fileOffset: target.clip.from,
1109
+ context: windowSignal ? request.context : void 0
1110
+ });
1111
+ if (file && cache && file === kindCacheFile(cache.dir, target, request, sampleRate))
1112
+ cacheKindAnalysis(file, analysis);
1113
+ return analysis;
1114
+ }
1115
+ async function analyzeWindow(target, signal, request, stream, cache) {
1116
+ const kindApart = request.capabilities.includes("kind") && target.clip !== void 0;
1117
+ if (!kindApart) return analyzeSignal(signal, request);
1118
+ const analysis = await analyzeSignal(signal, {
1119
+ ...request,
1120
+ capabilities: request.capabilities.filter((capability) => capability !== "kind")
1121
+ });
1122
+ let kind;
1123
+ try {
1124
+ kind = await clipKind(target, request, stream, cache, coversPart(target) ? void 0 : signal);
1125
+ if (!kind) throw new Error("no audio stream");
1126
+ } catch (error) {
1127
+ kind = await analyzeSignal(signal, { ...request, capabilities: ["kind"] });
1128
+ const reason = error instanceof Error ? error.message.split("\n")[0] : String(error);
1129
+ kind.warnings.push(
1130
+ `kind uses only the selected range: could not analyze the whole clip (${reason})`
1131
+ );
1132
+ }
1133
+ return {
1134
+ ...analysis,
1135
+ values: { ...analysis.values, kind: kind.values.kind },
1136
+ provenance: { ...analysis.provenance, ...kind.provenance },
1137
+ ladder: { ...analysis.ladder, ...kind.ladder },
1138
+ warnings: [.../* @__PURE__ */ new Set([...analysis.warnings, ...kind.warnings])]
1139
+ };
1140
+ }
1141
+ async function analyzeTarget(target, request, full, cacheDir) {
1003
1142
  const item = emptyItem(target);
1004
1143
  const problem = unreadable(target);
1005
1144
  if (problem) return { ...item, error: problem };
1006
1145
  const stream = await probeAudio(target.path);
1007
1146
  if (!stream) return { ...item, error: "no audio stream" };
1147
+ const cache = cacheDir ? { dir: cacheDir, identity: kindSourceIdentity(target.path) } : void 0;
1008
1148
  const { from, read: read2, context } = decodeSpan(target, stream);
1009
1149
  const decoded = await decodeAudio(target.path, read2, stream);
1010
1150
  if (!decoded) return { ...item, error: "no audio stream" };
1011
- const analysis = await analyzeSignal(decoded.signal, { ...request, fileOffset: from, context });
1151
+ const analysis = await analyzeWindow(
1152
+ target,
1153
+ decoded.signal,
1154
+ { ...request, fileOffset: from, context },
1155
+ stream,
1156
+ cache
1157
+ );
1012
1158
  return {
1013
1159
  ...item,
1014
1160
  window: { from: round5(from), to: round5(from + analysis.analyzed) },
@@ -1028,11 +1174,11 @@ async function analyzeTarget(target, request, full) {
1028
1174
  ]
1029
1175
  };
1030
1176
  }
1031
- async function analyzeTargets(targets, request, full = false) {
1177
+ async function analyzeTargets(targets, request, full = false, cacheDir) {
1032
1178
  const items = [];
1033
1179
  for (const target of targets) {
1034
1180
  try {
1035
- items.push(await analyzeTarget(target, request, full));
1181
+ items.push(await analyzeTarget(target, request, full, cacheDir));
1036
1182
  } catch (error) {
1037
1183
  const reason = error instanceof Error ? error.message.split("\n")[0] : String(error);
1038
1184
  items.push({ ...emptyItem(target), error: `could not read: ${reason}` });
@@ -1041,119 +1187,7 @@ async function analyzeTargets(targets, request, full = false) {
1041
1187
  return { version: 1, items };
1042
1188
  }
1043
1189
 
1044
- // src/audio/read/signal.ts
1045
- var READ_RATE = 22050;
1046
- var PITCH_RATE = 8e3;
1047
- var SILENT_DB = -120;
1048
- var ABSENT_DB = -55;
1049
- async function decodeMono(path, sampleRate = READ_RATE) {
1050
- const decoded = await decodeAudio(path, {}, void 0, { sampleRate, mono: true });
1051
- if (!decoded) throw new Error(`${path} has no audio stream`);
1052
- const samples = decoded.signal.channels[0];
1053
- if (samples.some((sample) => !Number.isFinite(sample)))
1054
- throw new Error(`${path} contains non-finite audio samples`);
1055
- return samples;
1056
- }
1057
- var asSignal = (samples, sampleRate = READ_RATE) => ({
1058
- sampleRate,
1059
- channels: [samples]
1060
- });
1061
- function mixed(tracks) {
1062
- const length = Math.max(0, ...tracks.map((t) => t.length));
1063
- const sum = new Float32Array(length);
1064
- for (const track2 of tracks) for (let i = 0; i < track2.length; i++) sum[i] += track2[i];
1065
- return sum;
1066
- }
1067
- function levels(samples, sampleRate, hop, window = hop * 2) {
1068
- const hopSamples = Math.max(1, hop * sampleRate);
1069
- const half = Math.max(1, Math.round(window * sampleRate / 2));
1070
- const squares = new Float64Array(samples.length + 1);
1071
- for (let i = 0; i < samples.length; i++) squares[i + 1] = squares[i] + samples[i] ** 2;
1072
- const frames = Math.ceil(samples.length / hopSamples);
1073
- const out = new Float32Array(frames);
1074
- for (let f = 0; f < frames; f++) {
1075
- const center = Math.round(f * hopSamples);
1076
- const a = Math.max(0, center - half);
1077
- const b = Math.min(samples.length, center + half);
1078
- const power = b > a ? (squares[b] - squares[a]) / (b - a) : 0;
1079
- out[f] = power > 0 ? Math.max(SILENT_DB, 10 * Math.log10(power)) : SILENT_DB;
1080
- }
1081
- return out;
1082
- }
1083
- function levelWhileHeardDb(samples, sampleRate) {
1084
- let sum = 0;
1085
- let heard = 0;
1086
- for (const db of levels(samples, sampleRate, 0.1, 0.4))
1087
- if (db >= ABSENT_DB) {
1088
- sum += 10 ** (db / 10);
1089
- heard++;
1090
- }
1091
- return heard ? Math.round(10 * Math.log10(sum / heard)) : null;
1092
- }
1093
- function quantile(values, q) {
1094
- if (!values.length) return NaN;
1095
- const sorted = Float64Array.from(values).sort();
1096
- return sorted[Math.min(sorted.length - 1, Math.max(0, Math.floor(q * (sorted.length - 1))))];
1097
- }
1098
- var median = (values) => quantile(values, 0.5);
1099
- var round6 = (n, places = 2) => {
1100
- const k = 10 ** places;
1101
- return Math.round(n * k) / k;
1102
- };
1103
- function spanDb(samples, sampleRate, start, end) {
1104
- const a = Math.max(0, Math.round(start * sampleRate));
1105
- const b = Math.min(samples.length, Math.round(end * sampleRate));
1106
- let sum = 0;
1107
- for (let i = a; i < b; i++) sum += samples[i] ** 2;
1108
- return b > a && sum > 0 ? Math.max(SILENT_DB, 10 * Math.log10(sum / (b - a))) : SILENT_DB;
1109
- }
1110
-
1111
1190
  // src/audio/read/pitch.ts
1112
- var FRAME = 320;
1113
- var HOP = 320;
1114
- var LOW_HZ = 70;
1115
- var HIGH_HZ = 500;
1116
- var VOICED_DB = -35;
1117
- var PERIODIC = 0.15;
1118
- var MIN_LAG = Math.floor(PITCH_RATE / HIGH_HZ);
1119
- var MAX_LAG = Math.ceil(PITCH_RATE / LOW_HZ);
1120
- function voiced(pcm, start) {
1121
- let energy = 0;
1122
- for (let i = 0; i < FRAME; i++) energy += pcm[start + i] ** 2;
1123
- return 10 * Math.log10(energy / FRAME + 1e-12) >= VOICED_DB;
1124
- }
1125
- function difference(pcm, start, tau) {
1126
- let sum = 0;
1127
- for (let i = 0; i < FRAME; i++) {
1128
- const delta = pcm[start + i] - pcm[start + i + tau];
1129
- sum += delta * delta;
1130
- }
1131
- return sum;
1132
- }
1133
- function periodOf(pcm, start, d) {
1134
- let running = 0;
1135
- let lag = -1;
1136
- for (let tau = 1; tau <= MAX_LAG; tau++) {
1137
- const sum = difference(pcm, start, tau);
1138
- running += sum;
1139
- d[tau] = running > 0 ? sum * tau / running : 1;
1140
- if (lag === -1) {
1141
- if (tau >= MIN_LAG && d[tau] < PERIODIC) lag = tau;
1142
- } else if (d[tau] > d[tau - 1]) break;
1143
- else if (d[tau] < d[lag]) lag = tau;
1144
- }
1145
- return lag;
1146
- }
1147
- function pitchTrack(pcm) {
1148
- const out = [];
1149
- const d = new Float64Array(MAX_LAG + 1);
1150
- for (let start = 0; start + FRAME + MAX_LAG <= pcm.length; start += HOP) {
1151
- if (!voiced(pcm, start)) continue;
1152
- const lag = periodOf(pcm, start, d);
1153
- if (lag > 0) out.push({ t: (start + FRAME / 2) / PITCH_RATE, hz: PITCH_RATE / lag });
1154
- }
1155
- return out;
1156
- }
1157
1191
  function within2(track2, start, end) {
1158
1192
  let lo = 0;
1159
1193
  let hi = track2.length;
@@ -1172,7 +1206,7 @@ var semitones = (a, b) => 12 * Math.log2(a / b);
1172
1206
  var PITCH_NOTE_SEMITONES = 3;
1173
1207
  var KIND_WIDTH = 8;
1174
1208
  var QUIET_DB = -45;
1175
- var SILENT_DB2 = -55;
1209
+ var SILENT_DB = -55;
1176
1210
  var LEVEL_DB = 0.5;
1177
1211
  var s2 = (t) => t.toFixed(1);
1178
1212
  var signed = (db) => `${db >= 0 ? "+" : ""}${db} dB`;
@@ -1255,7 +1289,7 @@ function pauseLine(pause, analysis) {
1255
1289
  ...analysis.music?.segments.filter((m) => inside(m.start, m.end)).map((m) => `music ${clip(m.start, m.end)}`) ?? [],
1256
1290
  ...analysis.ambience?.filter((a) => inside(a.start, a.end)).map((a) => `ambience ${clip(a.start, a.end)}`) ?? []
1257
1291
  ];
1258
- if (!beds.length && pause.recordingDb >= SILENT_DB2)
1292
+ if (!beds.length && pause.recordingDb >= SILENT_DB)
1259
1293
  beds.push(`sound continues at ${dbfs(pause.recordingDb)}`);
1260
1294
  const effects = effectsIn(
1261
1295
  analysis.effects?.events.filter((e) => e.t >= pause.start && e.t < pause.end) ?? []
@@ -1328,19 +1362,85 @@ function formatRead(analysis, range) {
1328
1362
  }
1329
1363
 
1330
1364
  // src/audio/read/read.ts
1331
- import { createHash as createHash2 } from "crypto";
1365
+ import { createHash as createHash3 } from "crypto";
1332
1366
  import {
1333
1367
  createReadStream,
1334
1368
  existsSync as existsSync5,
1335
- mkdirSync as mkdirSync2,
1336
- readFileSync as readFileSync2,
1337
- renameSync,
1338
- writeFileSync as writeFileSync2
1369
+ mkdirSync as mkdirSync3,
1370
+ readFileSync as readFileSync3,
1371
+ renameSync as renameSync2,
1372
+ writeFileSync as writeFileSync3
1339
1373
  } from "fs";
1340
- import { basename, extname, join as join6 } from "path";
1374
+ import { basename, extname, join as join7 } from "path";
1375
+
1376
+ // src/audio/read/signal.ts
1377
+ var READ_RATE = 22050;
1378
+ var SILENT_DB2 = -120;
1379
+ var ABSENT_DB = -55;
1380
+ async function decodeMono(path, sampleRate = READ_RATE) {
1381
+ const decoded = await decodeAudio(path, {}, void 0, { sampleRate, mono: true });
1382
+ if (!decoded) throw new Error(`${path} has no audio stream`);
1383
+ const samples = decoded.signal.channels[0];
1384
+ if (samples.some((sample) => !Number.isFinite(sample)))
1385
+ throw new Error(`${path} contains non-finite audio samples`);
1386
+ return samples;
1387
+ }
1388
+ var asSignal = (samples, sampleRate = READ_RATE) => ({
1389
+ sampleRate,
1390
+ channels: [samples]
1391
+ });
1392
+ function mixed(tracks) {
1393
+ const length = Math.max(0, ...tracks.map((t) => t.length));
1394
+ const sum = new Float32Array(length);
1395
+ for (const track2 of tracks) for (let i = 0; i < track2.length; i++) sum[i] += track2[i];
1396
+ return sum;
1397
+ }
1398
+ function levels(samples, sampleRate, hop, window = hop * 2) {
1399
+ const hopSamples = Math.max(1, hop * sampleRate);
1400
+ const half = Math.max(1, Math.round(window * sampleRate / 2));
1401
+ const squares = new Float64Array(samples.length + 1);
1402
+ for (let i = 0; i < samples.length; i++) squares[i + 1] = squares[i] + samples[i] ** 2;
1403
+ const frames = Math.ceil(samples.length / hopSamples);
1404
+ const out = new Float32Array(frames);
1405
+ for (let f = 0; f < frames; f++) {
1406
+ const center = Math.round(f * hopSamples);
1407
+ const a = Math.max(0, center - half);
1408
+ const b = Math.min(samples.length, center + half);
1409
+ const power = b > a ? (squares[b] - squares[a]) / (b - a) : 0;
1410
+ out[f] = power > 0 ? Math.max(SILENT_DB2, 10 * Math.log10(power)) : SILENT_DB2;
1411
+ }
1412
+ return out;
1413
+ }
1414
+ function levelWhileHeardDb(samples, sampleRate) {
1415
+ let sum = 0;
1416
+ let heard = 0;
1417
+ for (const db of levels(samples, sampleRate, 0.1, 0.4))
1418
+ if (db >= ABSENT_DB) {
1419
+ sum += 10 ** (db / 10);
1420
+ heard++;
1421
+ }
1422
+ return heard ? Math.round(10 * Math.log10(sum / heard)) : null;
1423
+ }
1424
+ function quantile(values, q) {
1425
+ if (!values.length) return NaN;
1426
+ const sorted = Float64Array.from(values).sort();
1427
+ return sorted[Math.min(sorted.length - 1, Math.max(0, Math.floor(q * (sorted.length - 1))))];
1428
+ }
1429
+ var median = (values) => quantile(values, 0.5);
1430
+ var round6 = (n, places = 2) => {
1431
+ const k = 10 ** places;
1432
+ return Math.round(n * k) / k;
1433
+ };
1434
+ function spanDb(samples, sampleRate, start, end) {
1435
+ const a = Math.max(0, Math.round(start * sampleRate));
1436
+ const b = Math.min(samples.length, Math.round(end * sampleRate));
1437
+ let sum = 0;
1438
+ for (let i = a; i < b; i++) sum += samples[i] ** 2;
1439
+ return b > a && sum > 0 ? Math.max(SILENT_DB2, 10 * Math.log10(sum / (b - a))) : SILENT_DB2;
1440
+ }
1341
1441
 
1342
1442
  // src/audio/read/effects.ts
1343
- var HOP2 = 0.01;
1443
+ var HOP = 0.01;
1344
1444
  var FLOOR_FRAMES = 150;
1345
1445
  var FLOOR_EVERY = 10;
1346
1446
  var RISE_DB = 20;
@@ -1354,7 +1454,7 @@ var TRAIN_GAP = 0.2;
1354
1454
  var BEAT_SLACK = 0.05;
1355
1455
  var ON_BEAT_SHARE = 0.7;
1356
1456
  var DRUM_GROUP_MIN = 8;
1357
- var LOW_HZ2 = 150;
1457
+ var LOW_HZ = 150;
1358
1458
  var BAND_FPS = 100;
1359
1459
  var SETTLE_FRAMES = 5;
1360
1460
  var PEAK_SLACK = 0.05;
@@ -1377,14 +1477,14 @@ function floors(db) {
1377
1477
  var BLOCK = 1e-3;
1378
1478
  function refined(samples, sampleRate, frame2, floorDb) {
1379
1479
  const block = Math.max(1, Math.round(BLOCK * sampleRate));
1380
- const from = Math.max(0, Math.round((frame2 - 2) * HOP2 * sampleRate));
1381
- const to = Math.min(samples.length, Math.round((frame2 + 2) * HOP2 * sampleRate));
1480
+ const from = Math.max(0, Math.round((frame2 - 2) * HOP * sampleRate));
1481
+ const to = Math.min(samples.length, Math.round((frame2 + 2) * HOP * sampleRate));
1382
1482
  for (let a = from; a + block <= to; a += block) {
1383
1483
  let power = 0;
1384
1484
  for (let i = a; i < a + block; i++) power += samples[i] ** 2;
1385
1485
  if (10 * Math.log10(power / block + 1e-12) >= floorDb + RISE_DB / 2) return a / sampleRate;
1386
1486
  }
1387
- return frame2 * HOP2;
1487
+ return frame2 * HOP;
1388
1488
  }
1389
1489
  function onsetOf(db, f, base2, from) {
1390
1490
  let onset = f;
@@ -1397,7 +1497,7 @@ function extent(db, f, floor, from) {
1397
1497
  const onset = onsetOf(db, f, base2, from);
1398
1498
  let peak = f;
1399
1499
  let end = f;
1400
- const last = Math.min(db.length - 1, f + LONGEST / HOP2);
1500
+ const last = Math.min(db.length - 1, f + LONGEST / HOP);
1401
1501
  for (let g = f; g <= last; g++) {
1402
1502
  if (g >= f + SETTLE_FRAMES && startsAgain(db, g, f + 1, floor[g])) break;
1403
1503
  if (db[g] > db[peak]) peak = g;
@@ -1424,7 +1524,7 @@ function detect(db, samples, sampleRate, skip) {
1424
1524
  if (!startsHere(db, f, floor[f])) continue;
1425
1525
  const { onset, peak, end } = extent(db, f, floor, from);
1426
1526
  const t = refined(samples, sampleRate, onset, Math.max(floor[f], db[onset - 1] ?? -120));
1427
- if (!skip(t)) found.push({ t, peak: peak * HOP2, end: end * HOP2, peakDb: db[peak] });
1527
+ if (!skip(t)) found.push({ t, peak: peak * HOP, end: end * HOP, peakDb: db[peak] });
1428
1528
  from = end + 1;
1429
1529
  f = Math.max(end, onset + 8);
1430
1530
  }
@@ -1451,7 +1551,7 @@ function shape(bands, from, to) {
1451
1551
  function lowShare(power) {
1452
1552
  const e = energies(power);
1453
1553
  const total = e.reduce((a, b) => a + b, 0);
1454
- const low = e.reduce((sum, p, k) => sum + (bandHz(k) < LOW_HZ2 ? p : 0), 0);
1554
+ const low = e.reduce((sum, p, k) => sum + (bandHz(k) < LOW_HZ ? p : 0), 0);
1455
1555
  return total > 0 ? low / total : 0;
1456
1556
  }
1457
1557
  function centroidHz(power) {
@@ -1554,9 +1654,9 @@ function majority(kinds) {
1554
1654
  return [...counts].sort((a, b) => b[1] - a[1])[0][0];
1555
1655
  }
1556
1656
  function foundIn({ samples: source, heldBy = [] }, input, mixDb) {
1557
- const db = source === input.mix ? mixDb : levels(source, input.sampleRate, HOP2);
1657
+ const db = source === input.mix ? mixDb : levels(source, input.sampleRate, HOP);
1558
1658
  const inSpeech = (t) => input.speech.some((s3) => t >= s3.start - SPEECH_SLACK && t < s3.end);
1559
- const masked = (f) => f.peakDb < (mixDb[Math.round(f.peak / HOP2)] ?? -120) - MASKED_DB;
1659
+ const masked = (f) => f.peakDb < (mixDb[Math.round(f.peak / HOP)] ?? -120) - MASKED_DB;
1560
1660
  const held = (f) => heldBy.some((span) => f.t < span.end && f.peak >= span.start);
1561
1661
  const found = detect(db, source, input.sampleRate, inSpeech).filter(
1562
1662
  (f) => !masked(f) && !held(f)
@@ -1580,8 +1680,8 @@ function measured2(input, mixDb) {
1580
1680
  return out;
1581
1681
  }
1582
1682
  function peakInMix(mixDb, m) {
1583
- const a = Math.max(0, Math.round((m.peak - PEAK_SLACK) / HOP2));
1584
- const b = Math.min(mixDb.length - 1, Math.round((m.peak + PEAK_SLACK) / HOP2));
1683
+ const a = Math.max(0, Math.round((m.peak - PEAK_SLACK) / HOP));
1684
+ const b = Math.min(mixDb.length - 1, Math.round((m.peak + PEAK_SLACK) / HOP));
1585
1685
  let peak = -120;
1586
1686
  for (let f = a; f <= b; f++) peak = Math.max(peak, mixDb[f]);
1587
1687
  return peak;
@@ -1595,8 +1695,8 @@ function musicNear(input, m, segment) {
1595
1695
  }
1596
1696
  function levelsOf(input, mixDb, m) {
1597
1697
  const peakDb = peakInMix(mixDb, m);
1598
- const a = Math.max(0, Math.round((m.t - BEFORE) / HOP2));
1599
- const b = Math.max(a, Math.round((m.t - GAP) / HOP2));
1698
+ const a = Math.max(0, Math.round((m.t - BEFORE) / HOP));
1699
+ const b = Math.max(a, Math.round((m.t - GAP) / HOP));
1600
1700
  const beforeDb = b > a ? quantile(mixDb.subarray(a, b), 0.5) : -120;
1601
1701
  const segment = input.music ? input.musicSegments?.find((span) => m.t >= span.start && m.t < span.end) : void 0;
1602
1702
  const musicDb = segment ? musicNear(input, m, segment) : null;
@@ -1629,7 +1729,7 @@ function effectOf(m, group, kind, levels2) {
1629
1729
  };
1630
1730
  }
1631
1731
  function findEffects(input) {
1632
- const mixDb = levels(input.mix, input.sampleRate, HOP2);
1732
+ const mixDb = levels(input.mix, input.sampleRate, HOP);
1633
1733
  const sounds = measured2(input, mixDb);
1634
1734
  const members = /* @__PURE__ */ new Map();
1635
1735
  for (const m of sounds) members.set(m.group, [...members.get(m.group) ?? [], m]);
@@ -1658,7 +1758,7 @@ function findEffects(input) {
1658
1758
  }
1659
1759
 
1660
1760
  // src/audio/read/music.ts
1661
- var HOP3 = 0.1;
1761
+ var HOP2 = 0.1;
1662
1762
  var CUT_DB = 25;
1663
1763
  var RUNNING_FRAMES = 200;
1664
1764
  var LEVEL_WINDOW = 0.4;
@@ -1690,8 +1790,8 @@ function joined(spans, tooShort2) {
1690
1790
  return out;
1691
1791
  }
1692
1792
  function powerDb(db, start, end) {
1693
- const a = Math.max(0, Math.round(start / HOP3));
1694
- const b = Math.min(db.length, Math.round(end / HOP3));
1793
+ const a = Math.max(0, Math.round(start / HOP2));
1794
+ const b = Math.min(db.length, Math.round(end / HOP2));
1695
1795
  let sum = 0;
1696
1796
  for (let f = a; f < b; f++) sum += 10 ** (db[f] / 10);
1697
1797
  return b > a ? 10 * Math.log10(sum / (b - a) || 1e-12) : Number.NEGATIVE_INFINITY;
@@ -1710,14 +1810,14 @@ function candidates(quiet, from, to, absorbed = tooShort) {
1710
1810
  for (let f = from; f < to; f++) {
1711
1811
  const isQuiet = quiet[f] === 1;
1712
1812
  const last = spans[spans.length - 1];
1713
- if (last && last.quiet === isQuiet) last.end = (f + 1) * HOP3;
1714
- else spans.push({ quiet: isQuiet, start: f * HOP3, end: (f + 1) * HOP3 });
1813
+ if (last && last.quiet === isQuiet) last.end = (f + 1) * HOP2;
1814
+ else spans.push({ quiet: isQuiet, start: f * HOP2, end: (f + 1) * HOP2 });
1715
1815
  }
1716
1816
  return joined(spans, absorbed);
1717
1817
  }
1718
1818
  function silencesIn(db, span) {
1719
- const from = Math.round(span.start / HOP3);
1720
- const to = Math.min(db.length, Math.round(span.end / HOP3));
1819
+ const from = Math.round(span.start / HOP2);
1820
+ const to = Math.min(db.length, Math.round(span.end / HOP2));
1721
1821
  const absent = new Uint8Array(db.length);
1722
1822
  for (let f = from; f < to; f++) absent[f] = db[f] < ABSENT_DB ? 1 : 0;
1723
1823
  const shortSilence = (s3) => s3.quiet && s3.end - s3.start < LONGEST_REST;
@@ -1740,15 +1840,15 @@ function runs(db) {
1740
1840
  const settled = joined(merged, (s3) => !s3.quiet && s3.end - s3.start < SHORTEST_SEGMENT);
1741
1841
  return {
1742
1842
  segments: settled.filter((s3) => !s3.quiet),
1743
- breaks: settled.filter((s3) => s3.quiet && s3.start > 0 && s3.end < db.length * HOP3)
1843
+ breaks: settled.filter((s3) => s3.quiet && s3.start > 0 && s3.end < db.length * HOP2)
1744
1844
  };
1745
1845
  }
1746
1846
  function soundShare(fine, run) {
1747
- const a = Math.round(run.start / HOP3);
1748
- const b = Math.min(fine.length, Math.round(run.end / HOP3));
1847
+ const a = Math.round(run.start / HOP2);
1848
+ const b = Math.min(fine.length, Math.round(run.end / HOP2));
1749
1849
  const heard = new Float64Array(b - a + 1);
1750
1850
  for (let f = a; f < b; f++) heard[f - a + 1] = heard[f - a] + (fine[f] >= ABSENT_DB ? 1 : 0);
1751
- const half = Math.round(DENSE_WINDOW / 2 / HOP3);
1851
+ const half = Math.round(DENSE_WINDOW / 2 / HOP2);
1752
1852
  const out = new Float32Array(b - a);
1753
1853
  for (let f = a; f < b; f++) {
1754
1854
  const lo = Math.max(a, f - half);
@@ -1758,9 +1858,9 @@ function soundShare(fine, run) {
1758
1858
  return out;
1759
1859
  }
1760
1860
  function steadyEdges(fine, part) {
1761
- const steady = Math.round(STEADY / HOP3);
1762
- const a = Math.round(part.start / HOP3);
1763
- const b = Math.min(fine.length, Math.round(part.end / HOP3));
1861
+ const steady = Math.round(STEADY / HOP2);
1862
+ const a = Math.round(part.start / HOP2);
1863
+ const b = Math.min(fine.length, Math.round(part.end / HOP2));
1764
1864
  const holds = (f) => {
1765
1865
  for (let k = f; k < f + steady; k++) if (k >= b || fine[k] < ABSENT_DB) return false;
1766
1866
  return true;
@@ -1769,18 +1869,18 @@ function steadyEdges(fine, part) {
1769
1869
  while (start < b && !holds(start)) start++;
1770
1870
  let end = b;
1771
1871
  while (end > start && !holds(end - steady)) end--;
1772
- return start < end ? { ...part, start: start * HOP3, end: end * HOP3 } : part;
1872
+ return start < end ? { ...part, start: start * HOP2, end: end * HOP2 } : part;
1773
1873
  }
1774
1874
  function sustainedParts(fine, run) {
1775
1875
  if (run.end - run.start <= DENSE_WINDOW) {
1776
- const a2 = Math.round(run.start / HOP3);
1777
- const b = Math.max(a2 + 1, Math.min(fine.length, Math.round(run.end / HOP3)));
1876
+ const a2 = Math.round(run.start / HOP2);
1877
+ const b = Math.max(a2 + 1, Math.min(fine.length, Math.round(run.end / HOP2)));
1778
1878
  let heard = 0;
1779
1879
  for (let f = a2; f < b; f++) if (fine[f] >= ABSENT_DB) heard++;
1780
1880
  return heard / (b - a2) >= DENSE_SHARE ? [run] : [];
1781
1881
  }
1782
1882
  const dense = soundShare(fine, run);
1783
- const a = Math.round(run.start / HOP3);
1883
+ const a = Math.round(run.start / HOP2);
1784
1884
  const sparse = new Uint8Array(fine.length);
1785
1885
  dense.forEach((share, i) => sparse[a + i] = share < DENSE_SHARE ? 1 : 0);
1786
1886
  return candidates(sparse, a, a + dense.length).filter((part) => !part.quiet).map((part) => steadyEdges(fine, part)).map(({ start, end }) => ({ start, end: Math.min(end, run.end) }));
@@ -1839,13 +1939,13 @@ function beatsInRun(signal, run) {
1839
1939
  }
1840
1940
  var sameTempo = (a, b) => a === null || b === null || Math.abs(a - b) / Math.max(a, b) <= SAME_TEMPO;
1841
1941
  function fadeFrom(db, run) {
1842
- const a = Math.floor(run.start / HOP3);
1843
- const b = Math.min(db.length, Math.floor(run.end / HOP3));
1942
+ const a = Math.floor(run.start / HOP2);
1943
+ const b = Math.min(db.length, Math.floor(run.end / HOP2));
1844
1944
  const body = median(db.subarray(a, b));
1845
1945
  const last = db[b - 1] ?? body;
1846
1946
  if (body - last < FADE_DB) return null;
1847
- for (let f = Math.max(a, b - FADE_WINDOW / HOP3); f < b; f++)
1848
- if (db[f] < body - 3) return round6(f * HOP3, 1);
1947
+ for (let f = Math.max(a, b - FADE_WINDOW / HOP2); f < b; f++)
1948
+ if (db[f] < body - 3) return round6(f * HOP2, 1);
1849
1949
  return null;
1850
1950
  }
1851
1951
  var leading = (mix) => Object.entries(mix).filter(([, share]) => share >= LEADING_SHARE).sort((a, b) => b[1] - a[1]).map(([name]) => name);
@@ -1891,9 +1991,9 @@ function energyCurve(melodic, sampleRate, duration, musical) {
1891
1991
  }
1892
1992
  function readMusic(input) {
1893
1993
  const melodic = mixed(Object.values(input.stems));
1894
- const db = levels(melodic, input.sampleRate, HOP3, LEVEL_WINDOW);
1994
+ const db = levels(melodic, input.sampleRate, HOP2, LEVEL_WINDOW);
1895
1995
  const duration = melodic.length / input.sampleRate;
1896
- const fine = levels(melodic, input.sampleRate, HOP3, HOP3);
1996
+ const fine = levels(melodic, input.sampleRate, HOP2, HOP2);
1897
1997
  const { segments: whole, breaks } = runs(db);
1898
1998
  for (const run of whole) run.end = Math.min(run.end, duration);
1899
1999
  const found = whole.flatMap((run) => sustainedParts(fine, run));
@@ -1955,11 +2055,11 @@ function readMusic(input) {
1955
2055
  }
1956
2056
 
1957
2057
  // src/audio/read/stems.ts
1958
- import { randomUUID as randomUUID2 } from "crypto";
1959
- import { existsSync as existsSync4, mkdirSync, readFileSync, statSync, writeFileSync } from "fs";
2058
+ import { randomUUID as randomUUID3 } from "crypto";
2059
+ import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "fs";
1960
2060
  import { mkdtemp as mkdtemp2, rm as rm2 } from "fs/promises";
1961
2061
  import { tmpdir as tmpdir2 } from "os";
1962
- import { join as join5 } from "path";
2062
+ import { join as join6 } from "path";
1963
2063
  import { setTimeout as sleep } from "timers/promises";
1964
2064
  var URL_ENV2 = "HYPERFRAMES_AUDIO_STEMS_URL";
1965
2065
  var KEY_ENV2 = "HYPERFRAMES_AUDIO_API_KEY";
@@ -1976,11 +2076,11 @@ var stemsAccess = () => serviceAccess(
1976
2076
  DEFAULT_TIMEOUT_MS2
1977
2077
  );
1978
2078
  function cachedStems(dir) {
1979
- const done = join5(dir, DONE);
2079
+ const done = join6(dir, DONE);
1980
2080
  if (!existsSync4(done)) return null;
1981
- const names = JSON.parse(readFileSync(done, "utf8"));
2081
+ const names = JSON.parse(readFileSync2(done, "utf8"));
1982
2082
  if (!STEM_NAMES.every((name) => typeof names[name] === "string")) return null;
1983
- const paths = Object.fromEntries(STEM_NAMES.map((name) => [name, join5(dir, names[name])]));
2083
+ const paths = Object.fromEntries(STEM_NAMES.map((name) => [name, join6(dir, names[name])]));
1984
2084
  return Object.values(paths).every((p) => existsSync4(p)) ? paths : null;
1985
2085
  }
1986
2086
  var StillRunning = class extends Error {
@@ -2005,7 +2105,7 @@ async function encoded(path, dir, signal) {
2005
2105
  if (!ffmpeg) throw new Error("ffmpeg is required to separate stems; run: npx hyperframes doctor");
2006
2106
  const audio = await probeAudio(path);
2007
2107
  if (!audio) throw new Error("the recording has no audio track ffmpeg can decode");
2008
- const out = join5(dir, "upload.mp3");
2108
+ const out = join6(dir, "upload.mp3");
2009
2109
  await runFile(
2010
2110
  ffmpeg,
2011
2111
  [
@@ -2028,7 +2128,7 @@ async function separated(url, request, signal) {
2028
2128
  }
2029
2129
  async function fetchStems(path, dir, { url, headers, timeoutMs }) {
2030
2130
  const signal = AbortSignal.timeout(timeoutMs);
2031
- const scratch = await mkdtemp2(join5(tmpdir2(), "hf-stems-"));
2131
+ const scratch = await mkdtemp2(join6(tmpdir2(), "hf-stems-"));
2032
2132
  try {
2033
2133
  const mp3 = await encoded(path, scratch, signal);
2034
2134
  const client = new HyperframesCloudClient({
@@ -2039,10 +2139,10 @@ async function fetchStems(path, dir, { url, headers, timeoutMs }) {
2039
2139
  const asset = await uploadAssetViaDirectUpload({
2040
2140
  client,
2041
2141
  path: mp3,
2042
- size: statSync(mp3).size,
2142
+ size: statSync2(mp3).size,
2043
2143
  filename: "audio.mp3",
2044
2144
  contentType: "audio/mpeg",
2045
- idempotencyKey: randomUUID2(),
2145
+ idempotencyKey: randomUUID3(),
2046
2146
  signal
2047
2147
  });
2048
2148
  const current = await separated(
@@ -2052,7 +2152,7 @@ async function fetchStems(path, dir, { url, headers, timeoutMs }) {
2052
2152
  redirect: "error",
2053
2153
  headers: {
2054
2154
  ...headers,
2055
- "idempotency-key": randomUUID2(),
2155
+ "idempotency-key": randomUUID3(),
2056
2156
  "content-type": "application/json"
2057
2157
  },
2058
2158
  body: JSON.stringify({ version: 1, audio: { type: "asset_id", asset_id: asset.asset_id } })
@@ -2069,16 +2169,16 @@ async function fetchStems(path, dir, { url, headers, timeoutMs }) {
2069
2169
  throw new Error(
2070
2170
  `the stems service returned an incomplete separation: missing ${missing.join(", ")}`
2071
2171
  );
2072
- mkdirSync(dir, { recursive: true });
2172
+ mkdirSync2(dir, { recursive: true });
2073
2173
  const names = {};
2074
2174
  for (const name of STEM_NAMES) {
2075
2175
  const stem = stems.find((candidate) => candidate.name === name);
2076
2176
  if (!stem) continue;
2077
2177
  const file = `${name}.audio`;
2078
- await downloadToFile(stem.url, join5(dir, file), { signal });
2178
+ await downloadToFile(stem.url, join6(dir, file), { signal });
2079
2179
  names[name] = file;
2080
2180
  }
2081
- writeFileSync(join5(dir, DONE), JSON.stringify(names));
2181
+ writeFileSync2(join6(dir, DONE), JSON.stringify(names));
2082
2182
  return cachedStems(dir);
2083
2183
  } finally {
2084
2184
  await rm2(scratch, { recursive: true, force: true });
@@ -2221,7 +2321,7 @@ function voiceFromActivity(vocals, sampleRate, track2, levelOf) {
2221
2321
 
2222
2322
  // src/audio/read/read.ts
2223
2323
  async function sha256(path) {
2224
- const hash = createHash2("sha256");
2324
+ const hash = createHash3("sha256");
2225
2325
  for await (const chunk of createReadStream(path)) hash.update(chunk);
2226
2326
  return hash.digest("hex");
2227
2327
  }
@@ -2233,11 +2333,11 @@ function transcriptFor(path, given) {
2233
2333
  function wordsOf(transcript) {
2234
2334
  return loadTranscript(transcript).words.map(({ text, start, end }) => ({ text, start, end }));
2235
2335
  }
2236
- var fingerprint = (path) => path ? createHash2("sha256").update(readFileSync2(path)).digest("hex").slice(0, 16) : "none";
2336
+ var fingerprint = (path) => path ? createHash3("sha256").update(readFileSync3(path)).digest("hex").slice(0, 16) : "none";
2237
2337
  function writeAtomic(path, content) {
2238
2338
  const temporary = `${path}.${process.pid}.tmp`;
2239
- writeFileSync2(temporary, content);
2240
- renameSync(temporary, path);
2339
+ writeFileSync3(temporary, content);
2340
+ renameSync2(temporary, path);
2241
2341
  }
2242
2342
  async function stemsFor(path, dir, quality, warnings) {
2243
2343
  const cached = cachedStems(dir);
@@ -2379,12 +2479,12 @@ async function readAudio(path, file, options) {
2379
2479
  const transcript = transcriptFor(path, options.transcript);
2380
2480
  const transcriptKey = fingerprint(transcript);
2381
2481
  const stem = `${basename(file, extname(file)).replace(/[^\w.-]/g, "_")}-${sha.slice(0, 12)}`;
2382
- mkdirSync2(options.cacheDir, { recursive: true });
2383
- const jsonPath = join6(options.cacheDir, `${stem}.json`);
2384
- const textPath = join6(options.cacheDir, `${stem}.txt`);
2385
- const stemDir = join6(options.cacheDir, "stems", sha.slice(0, 12));
2482
+ mkdirSync3(options.cacheDir, { recursive: true });
2483
+ const jsonPath = join7(options.cacheDir, `${stem}.json`);
2484
+ const textPath = join7(options.cacheDir, `${stem}.txt`);
2485
+ const stemDir = join7(options.cacheDir, "stems", sha.slice(0, 12));
2386
2486
  if (existsSync5(jsonPath) && existsSync5(textPath)) {
2387
- const entry = JSON.parse(readFileSync2(jsonPath, "utf8"));
2487
+ const entry = JSON.parse(readFileSync3(jsonPath, "utf8"));
2388
2488
  const stemsNowPossible = entry.analysis.separation === "mix" && quality === "best" && (cachedStems(stemDir) !== null || typeof await stemsAccess() !== "string");
2389
2489
  if ((entry.analysis.separation !== "stems" || cachedStems(stemDir) !== null) && entry.analysis.version === READ_VERSION && entry.transcriptKey === transcriptKey && !stemsNowPossible)
2390
2490
  return { analysis: entry.analysis, textPath, jsonPath, cached: true };
@@ -2525,7 +2625,7 @@ async function read(files, flags) {
2525
2625
  const quality = readQuality(files, flags);
2526
2626
  const range = pair("range", flags.range);
2527
2627
  const result = await readAudio(resolve2(process.cwd(), files[0]), files[0], {
2528
- cacheDir: join7(resolve2(flags.dir ?? process.cwd()), ".hyperframes", "read-audio"),
2628
+ cacheDir: join8(resolve2(flags.dir ?? process.cwd()), ".hyperframes", "read-audio"),
2529
2629
  transcript: flags.transcript ? resolve2(process.cwd(), flags.transcript) : void 0,
2530
2630
  quality
2531
2631
  });
@@ -2611,7 +2711,12 @@ var audio_default = defineCommand({
2611
2711
  const query = filmQuery(flags);
2612
2712
  if (files.length && query) throw new CliUsageError("give files or a film query, not both");
2613
2713
  const targets = files.length ? await fileTargets(files, flags) : await clipTargets(flags, query);
2614
- const report = await analyzeTargets(targets, analyzeRequest(flags), Boolean(args.full));
2714
+ const report = await analyzeTargets(
2715
+ targets,
2716
+ analyzeRequest(flags),
2717
+ Boolean(args.full),
2718
+ join8(resolve2(flags.dir ?? process.cwd()), ".hyperframes", "audio-kind")
2719
+ );
2615
2720
  console.log(args.json ? JSON.stringify(withMeta(report)) : formatReport(report));
2616
2721
  }
2617
2722
  });