hyperframes 0.8.205 → 0.8.207
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/hyperframes.mjs +1 -0
- package/dist/{add-BA4AU262.js → add-LXFWHBE3.js} +19 -18
- package/dist/{agentPromptGenerator-KYO5MKTW.js → agentPromptGenerator-D2E62ZP5.js} +1 -1
- package/dist/{animatedGifPrep-UNUCFGLQ.js → animatedGifPrep-VBPJZKFT.js} +21 -15
- package/dist/api.js +31 -31
- package/dist/{appHistory-QVCSAOI4.js → appHistory-HIBH6XZW.js} +3 -1
- package/dist/{asset-KCDVTNC3.js → asset-JX4RW3GO.js} +2 -2
- package/dist/{assetCataloger-5FCVQ3N6.js → assetCataloger-JKKOPBCF.js} +15 -14
- package/dist/{audio-KDBPEHRS.js → audio-OXQ3L6DW.js} +24 -24
- package/dist/{auth-IMPBZZXJ.js → auth-JAL7P7ZA.js} +1 -1
- package/dist/{autoUpdate-YE2RKCAG.js → autoUpdate-MRI2AICE.js} +2 -2
- package/dist/{backgroundChecks-OWY2UFSR.js → backgroundChecks-ORR46PBY.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-AN4HWKET.js → batchRender-IFZYPGIW.js} +9 -9
- package/dist/{beats-VTQJ4JH6.js → beats-UDLOEW6U.js} +21 -21
- package/dist/{benchmark-PBEWHJ5K.js → benchmark-VTVDNKSO.js} +14 -14
- package/dist/{browser-E7ANEHNU.js → browser-QJC4BL2Y.js} +6 -6
- package/dist/{bundleWithLocalizedFonts-I3BWMRSP.js → bundleWithLocalizedFonts-Z2JTBNDS.js} +2 -2
- package/dist/{capture-MP7R72WU.js → capture-2P4JERSX.js} +14 -3
- package/dist/{capture-XODFC4S4.js → capture-GLM2ACPM.js} +81 -41
- package/dist/{captureCompositionFrame-2OYGVDI3.js → captureCompositionFrame-A2A5MGQB.js} +19 -19
- package/dist/{captureFile-LYOJOUIE.js → captureFile-RPUEOZO6.js} +1 -1
- package/dist/{catalog-ORVCCEQR.js → catalog-5ZLVUQVJ.js} +25 -24
- package/dist/{catch-up-SYAQOXTT.js → catch-up-FRMVYJHZ.js} +5 -5
- package/dist/{check-6SQR6SSA.js → check-WVY7SM7C.js} +50 -48
- package/dist/checkAudio-PLEQY3SZ.js +201 -0
- package/dist/{checkBrowser-HOTD3CDE.js → checkBrowser-XSZUA2DQ.js} +42 -41
- package/dist/{chunk-JFNB4CMI.js → chunk-526VSRZ4.js} +20 -8
- package/dist/{chunk-DQBY7FRR.js → chunk-543U46OR.js} +4 -1
- package/dist/{chunk-CUGADCIV.js → chunk-5KBMYSF2.js} +54 -15
- package/dist/{chunk-2ST4WAFY.js → chunk-5PCALX6G.js} +13 -1
- package/dist/{chunk-TZ7MTRVJ.js → chunk-5PYRU5DT.js} +13 -13
- package/dist/{chunk-AYH5ANVS.js → chunk-5YHQBCWH.js} +52 -3
- package/dist/{chunk-KBZSMKKD.js → chunk-63DP5CB2.js} +29 -3
- package/dist/{chunk-GLBEBBS2.js → chunk-6IYIS2U7.js} +2 -2
- package/dist/{chunk-GSTFETKE.js → chunk-6KCFVLO6.js} +5 -5
- package/dist/{chunk-EXRHI43B.js → chunk-6KOHY5EP.js} +10 -9
- package/dist/{chunk-CU76YDPX.js → chunk-6Z7XDUUJ.js} +1 -1
- package/dist/{chunk-XNAIYEKD.js → chunk-7PJ3AJB2.js} +1 -1
- package/dist/{chunk-6GAYBX5C.js → chunk-7RWUY3BJ.js} +64 -62
- package/dist/{chunk-3CISA3OS.js → chunk-AF3L5JJX.js} +1 -1
- package/dist/chunk-BDJIQZN2.js +4830 -0
- package/dist/{chunk-75WNFDRU.js → chunk-C53ZNJDZ.js} +4 -4
- package/dist/{chunk-GBQCTZON.js → chunk-CVZO6TFE.js} +13 -43
- package/dist/{chunk-RQDVTUVD.js → chunk-DJQZ7DEH.js} +15 -15
- package/dist/{chunk-KAIQPYCM.js → chunk-DML6BD4K.js} +2 -2
- package/dist/{chunk-BTYT3RT3.js → chunk-EG3B2VWK.js} +2 -2
- package/dist/{chunk-OB7QARSN.js → chunk-EGRIVMCQ.js} +1 -1
- package/dist/{chunk-V4K4BSCM.js → chunk-EHFZEKQM.js} +57 -5
- package/dist/{chunk-H4MSJ2NZ.js → chunk-FEO7YW7V.js} +8 -8
- package/dist/{chunk-FNBEYIZH.js → chunk-FVAI7AHF.js} +13 -12
- package/dist/{chunk-PLGGKTCB.js → chunk-GXUONASF.js} +13 -20
- package/dist/{chunk-L6N2TLXR.js → chunk-H3LQ5X6Q.js} +84 -79
- package/dist/{chunk-MVXOY5RC.js → chunk-HA3V4XAF.js} +6 -6
- package/dist/{chunk-WB55EQNJ.js → chunk-HM7SUIQD.js} +38 -9
- package/dist/{chunk-G445Y3YG.js → chunk-HVOTYAS4.js} +15 -7
- package/dist/{chunk-IKYXXIMP.js → chunk-I2TDHVFV.js} +3 -3
- package/dist/{chunk-3N4T6I3O.js → chunk-I3TYUQLB.js} +1 -1
- package/dist/{chunk-AECL3B23.js → chunk-IBZHSU2J.js} +1 -1
- package/dist/{chunk-2FEOM3ZT.js → chunk-ID766OZB.js} +12 -12
- package/dist/{chunk-4UIEQIF4.js → chunk-IK4JY2LI.js} +2 -2
- package/dist/{chunk-C4LV6L4Q.js → chunk-IW5P4KK7.js} +3 -3
- package/dist/{chunk-N7VQD4WB.js → chunk-IYZT62UR.js} +1 -1
- package/dist/chunk-JKE24AG7.js +62 -0
- package/dist/chunk-JLCAHJUO.js +91 -0
- package/dist/{chunk-EUFBE5BW.js → chunk-JLGVBK5M.js} +1 -1
- package/dist/{chunk-6NC4KBS2.js → chunk-JQ32262N.js} +1 -1
- package/dist/{chunk-J2E3VVOS.js → chunk-KDHHPJOG.js} +4 -4
- package/dist/{chunk-A42PDANH.js → chunk-LCCYYTEK.js} +1 -1
- package/dist/{chunk-T2UR3T4L.js → chunk-LK6KPVX2.js} +263 -74
- package/dist/{chunk-RWOWD3PW.js → chunk-LPI7HX4G.js} +2 -2
- package/dist/{chunk-UR6BAPOD.js → chunk-LXP6XWJL.js} +2 -2
- package/dist/{chunk-4RPCYGZG.js → chunk-MAUGXKSI.js} +4 -4
- package/dist/{chunk-AII6P2TC.js → chunk-MMJAHBH2.js} +1 -1
- package/dist/{chunk-LFGJWOVA.js → chunk-MNNK7RV5.js} +11 -8
- package/dist/{chunk-26OI2B2X.js → chunk-MSHL6CF2.js} +1 -1
- package/dist/{chunk-SVVAUJPL.js → chunk-NHA4NRBE.js} +136 -25
- package/dist/{chunk-5F6B6KMK.js → chunk-NHL5CMO2.js} +18 -3
- package/dist/{chunk-NF6KI46X.js → chunk-NJNC2DQV.js} +31 -28
- package/dist/{chunk-I7IXUCKL.js → chunk-NSC5A4IR.js} +1 -1
- package/dist/{chunk-MRF4AMKD.js → chunk-NWGXTUYS.js} +32 -10
- package/dist/{chunk-57I5KNTL.js → chunk-PL36HK3U.js} +3 -3
- package/dist/{chunk-TOEIJ4WF.js → chunk-PUIG6DHT.js} +5 -5
- package/dist/{chunk-BA7MQJXG.js → chunk-QE4WRS3N.js} +3 -3
- package/dist/{chunk-7V7OUKTU.js → chunk-QTWXVOZI.js} +1 -1
- package/dist/{chunk-V2XXV2EH.js → chunk-QZ2JQ6O4.js} +6 -6
- package/dist/{chunk-BHOGXIBO.js → chunk-RPZNQV6D.js} +58 -826
- package/dist/{chunk-2BGOB2QK.js → chunk-SE2MXV2N.js} +136 -25
- package/dist/{chunk-HADQPG7O.js → chunk-SXOD5J7T.js} +2 -2
- package/dist/{chunk-32R2AFZ3.js → chunk-T4JGFCXU.js} +3 -3
- package/dist/chunk-TQBQYO4L.js +55 -0
- package/dist/{chunk-ZSUWGNIT.js → chunk-TSTONNOD.js} +2 -2
- package/dist/chunk-TSYRN646.js +84 -0
- package/dist/{chunk-BZ727KLT.js → chunk-U32PA6DI.js} +1 -1
- package/dist/{chunk-5PVPGWMH.js → chunk-UAT2UMTP.js} +1 -1
- package/dist/{chunk-TGS33LDU.js → chunk-UKM3JYNB.js} +5 -71
- package/dist/{chunk-UEOGIZ3Q.js → chunk-UUOIH4RW.js} +3 -3
- package/dist/{chunk-MASFRPCB.js → chunk-UYPWH7PH.js} +10 -10
- package/dist/{chunk-LSQM3NBR.js → chunk-VAVDAOUA.js} +1 -1
- package/dist/chunk-VBPNCOD7.js +355 -0
- package/dist/{chunk-HQ3CFNHL.js → chunk-VH4PNYOS.js} +1 -1
- package/dist/{chunk-IXXVS2Z4.js → chunk-VQB7G5BM.js} +1 -1
- package/dist/{chunk-FLREUEHW.js → chunk-W4DMQZL5.js} +1 -1
- package/dist/{chunk-RXATE6FZ.js → chunk-WC4MTXGN.js} +22 -0
- package/dist/{chunk-F2ASNL2K.js → chunk-WL263XM2.js} +1 -1
- package/dist/{chunk-ZB6SCA4J.js → chunk-XAGBSYIQ.js} +9 -2
- package/dist/{chunk-LQUMMPGK.js → chunk-XKW4Z7BU.js} +1 -1
- package/dist/chunk-XMRA7CQG.js +22 -0
- package/dist/{chunk-6YYFNGCS.js → chunk-XULJBZ7K.js} +7 -4
- package/dist/chunk-YJK6HOL5.js +29 -0
- package/dist/{chunk-KVNXEAVT.js → chunk-ZCJ5EGLU.js} +30 -10
- package/dist/{chunk-ERUINDRT.js → chunk-ZF3R2IPC.js} +184 -183
- package/dist/{chunk-AECSY5LT.js → chunk-ZYGIDXAK.js} +569 -378
- package/dist/{clean-BW7NHQS5.js → clean-TL3IPJDN.js} +28 -28
- package/dist/cli.js +55 -55
- package/dist/{cloud-TZVXTWZO.js → cloud-EYMRPJNY.js} +4 -4
- package/dist/{cloudrun-KRIETALO.js → cloudrun-TOJ36NLX.js} +11 -11
- package/dist/commands/layout-audit.browser.js +3 -15
- package/dist/{compare-WYWHJ4CR.js → compare-MP5EOW4D.js} +40 -40
- package/dist/{compiler-ANIPXLJ7.js → compiler-NOPVLJ2S.js} +15 -15
- package/dist/{component-CY7DCX56.js → component-ASACDCZK.js} +3 -3
- package/dist/{compositions-5YEB24E3.js → compositions-WKNZJY34.js} +19 -19
- package/dist/{contactSheet-5APX35L3.js → contactSheet-YOBPATEM.js} +2 -2
- package/dist/{delete-6642PDON.js → delete-DQTFHP3G.js} +2 -2
- package/dist/{deploy-NZP6TZLS.js → deploy-HHCFOUFM.js} +4 -4
- package/dist/{deterministicFonts-HQYCUUAL.js → deterministicFonts-LKAGUNE5.js} +3 -3
- package/dist/{dist-V2BGP46S.js → dist-L4Z4ZEYW.js} +7 -4
- package/dist/{dist-DGFC75NC.js → dist-NQEYA4ZX.js} +44 -36
- package/dist/docs/rendering.md +3 -0
- package/dist/{doctor-ZW4A2FS3.js → doctor-JDM65CP7.js} +20 -20
- package/dist/{events-NJU4VFDA.js → events-MBRNA3UF.js} +3 -3
- package/dist/{events-XRCHY2F6.js → events-RKRHRLJD.js} +2 -2
- package/dist/{feedback-NQLSZMES.js → feedback-LZWIWV5J.js} +17 -17
- package/dist/{ffmpeg-RYDQLG3G.js → ffmpeg-4PZKSIGE.js} +15 -15
- package/dist/{figma-TJAMP2CI.js → figma-QFNYUT3F.js} +3 -3
- package/dist/fontLocalizeCli.js +20 -18
- package/dist/{get-RRZ3O26X.js → get-2B5ENJOH.js} +2 -2
- package/dist/{gpuPolicy-4WLHUUS3.js → gpuPolicy-E5FB2GFR.js} +13 -13
- package/dist/{grade-compare-P7PE3NAA.js → grade-compare-4GUAPJHE.js} +40 -40
- package/dist/{gsapParser-IEUSLYDJ.js → gsapParser-3H7ON3DO.js} +1 -1
- package/dist/{gsapParserAcorn-LZJKCFQI.js → gsapParserAcorn-5YD4N6HQ.js} +2 -2
- package/dist/hangReport.js +47 -0
- package/dist/heifImagePrep-C2RYIEER.js +53 -0
- package/dist/{help-6RELRVIW.js → help-XGDAXV67.js} +1 -1
- package/dist/{history-GIIDYND3.js → history-WNFF6HGU.js} +108 -60
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +75 -68
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/hyperframes-slideshow.global.js +16 -16
- package/dist/{info-LBUA2DXE.js → info-BR2LKGJD.js} +16 -16
- package/dist/{init-QUPXBONY.js → init-P6UWPUY3.js} +59 -58
- package/dist/{inspect-CL42DJZ4.js → inspect-MSRPF7ZO.js} +40 -39
- package/dist/inspection.js +4 -4
- package/dist/{installer-VR7XDLR3.js → installer-MPUQS3ZX.js} +10 -10
- package/dist/{keyframes-LELLROMA.js → keyframes-J6K66QTO.js} +11 -11
- package/dist/{lambda-I6KFXWOO.js → lambda-LJ2OSWFJ.js} +32 -13
- package/dist/{layout-NR6SNRZE.js → layout-CDY65XGA.js} +40 -39
- package/dist/{lint-DYEMSEQR.js → lint-CAUNBGPX.js} +13 -10
- package/dist/{lintProject-EA4NPL2X.js → lintProject-ZTSX3AWT.js} +7 -4
- package/dist/{list-RDURYO5U.js → list-33BYQNRZ.js} +2 -2
- package/dist/{login-VKLET5OL.js → login-5QMRKOHK.js} +4 -4
- package/dist/{manager-IYT3THJN.js → manager-3JOHHPVR.js} +17 -17
- package/dist/{manager-7TSUZKXU.js → manager-RMYSZ3KI.js} +7 -3
- package/dist/{media-treatment-I4AFEQZ3.js → media-treatment-4WP22CFN.js} +23 -23
- package/dist/{models-LLPVGC2E.js → models-HPWCHAZX.js} +28 -28
- package/dist/{motionShot-6A6HH6IK.js → motionShot-I7GDIROQ.js} +23 -23
- package/dist/{normalize-audio-KVQJBYLT.js → normalize-audio-VTMXPSC7.js} +14 -14
- package/dist/{open-J4ZT4X3C.js → open-SAO7OQTT.js} +19 -19
- package/dist/{parakeetRunner-FLUCIDIZ.js → parakeetRunner-ZYPBIA73.js} +25 -25
- package/dist/{pipeline-RRVLGALQ.js → pipeline-VNBMR6QU.js} +16 -16
- package/dist/{play-QGJSXUVM.js → play-7VI6A7KN.js} +42 -32
- package/dist/{preflight-SP2ZERBE.js → preflight-VWV7L45J.js} +17 -17
- package/dist/{present-UR4YBHMX.js → present-CSJGYOFF.js} +37 -27
- package/dist/{preview-6ENCRU4C.js → preview-B246ZTVO.js} +60 -45
- package/dist/{producer-OMHZRY6A.js → producer-WJLFDVQJ.js} +1 -1
- package/dist/{projectConfig-NGS7GJ47.js → projectConfig-OMR46ZWQ.js} +14 -13
- package/dist/{publication-6NYQA22Y.js → publication-AA7NNYET.js} +8 -8
- package/dist/{publish-E6RE5VHB.js → publish-TJ4QVVSP.js} +18 -17
- package/dist/{remove-background-66PQRA7R.js → remove-background-LQ2V7W7N.js} +20 -20
- package/dist/{render-ZLRJUFMX.js → render-AWEEPG3F.js} +39 -37
- package/dist/{render-SBAZWXPO.js → render-E5QJG74D.js} +14 -11
- package/dist/{render-IMSGS6BD.js → render-JLTNZ36U.js} +83 -51
- package/dist/{render-batch-MO7LYZSP.js → render-batch-U4T4VSCM.js} +14 -11
- package/dist/renderSetupWorker.js +11 -8
- package/dist/{resolver-QMBVTAKT.js → resolver-GXCTUKPV.js} +10 -10
- package/dist/{screenshotCapture-I5EDCITF.js → screenshotCapture-X6OKIXCB.js} +1 -1
- package/dist/{sherpa-JZRDL3OE.js → sherpa-4VZWVHWZ.js} +24 -24
- package/dist/skills/hyperframes-cli/references/init-and-scaffold.md +1 -0
- package/dist/skills/hyperframes-cli/references/lambda.md +3 -0
- package/dist/skills/hyperframes-cli/references/preview-render.md +3 -0
- package/dist/{skills-YBTEWFYS.js → skills-WUKR7SUE.js} +8 -8
- package/dist/{skillsUpdateCheck-Z4HTDZJN.js → skillsUpdateCheck-YXRBY3JC.js} +3 -3
- package/dist/{snapshot-5F5UV6H5.js → snapshot-Q7S2FTNG.js} +143 -77
- package/dist/{src-WWXYV2TS.js → src-CLAALR5W.js} +26 -19
- package/dist/{src-UTW3F2PM.js → src-ZOXUSGAP.js} +24 -12
- package/dist/{staticProjectServer-UHZ63C5O.js → staticProjectServer-DQ7PIDPA.js} +26 -26
- package/dist/studio/assets/hyperframes-player-Cm5aBiKq.js +478 -0
- package/dist/studio/assets/{index-dy6GQJn4.js → index-BF9YeBnC.js} +142 -142
- package/dist/studio/assets/{index-C8hp9Y7c.js → index-BrqAmMRt.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-BHZ3PHL2.js → studio-api-NUE227JM.js} +18 -18
- package/dist/{studioSelectionClient-IUUPKUHZ.js → studioSelectionClient-D6VMGTKQ.js} +1 -1
- package/dist/{studioServer-AFUXWRB5.js → studioServer-HVOKP4VI.js} +81 -70
- package/dist/{synthesize-PKTB5ATG.js → synthesize-QZHRXGRY.js} +30 -8
- package/dist/{telemetry-UYKOT4OJ.js → telemetry-2Y5JXLDB.js} +3 -3
- package/dist/{timeline-K5NLEMH4.js → timeline-WOQGXFRV.js} +28 -28
- package/dist/{tokens-FCOSWE2O.js → tokens-T3OHTWUC.js} +2 -2
- package/dist/{transcribe-SIFMTW5W.js → transcribe-4U74P5TG.js} +22 -22
- package/dist/{transcribe-K2QTXDQR.js → transcribe-JZ3BO546.js} +32 -32
- package/dist/{tts-5I2AJNLM.js → tts-AY4JO5NQ.js} +2 -2
- package/dist/{updateCheck-JZ6TBZVE.js → updateCheck-6EUAGAM4.js} +2 -2
- package/dist/{upgrade-TUPAJXQQ.js → upgrade-55K6F4MP.js} +2 -2
- package/dist/upstreamProxy-W5FWAT5Z.js +17 -0
- package/dist/{urlDownloader-L4775QID.js → urlDownloader-47JMOLNN.js} +12 -12
- package/dist/{validate-4HVVMEBV.js → validate-QBJ3SBS4.js} +32 -32
- package/dist/{video-4OGPF3IE.js → video-3ZAUNAR3.js} +17 -15
- package/dist/warmCheck.js +50 -48
- package/package.json +2 -1
- package/dist/chunk-4YYJOFKS.js +0 -28
- package/dist/chunk-ZUQZP6QD.js +0 -3986
- package/dist/studio/assets/hyperframes-player-DzdSmJdB.js +0 -478
|
@@ -8,85 +8,6 @@ import {
|
|
|
8
8
|
findFfBinary
|
|
9
9
|
} from "./chunk-VAS6HQX3.js";
|
|
10
10
|
|
|
11
|
-
// src/audio/analysis/decode.ts
|
|
12
|
-
import { execFile } from "child_process";
|
|
13
|
-
import { promisify } from "util";
|
|
14
|
-
var run = promisify(execFile);
|
|
15
|
-
function requiredBinary(name) {
|
|
16
|
-
const path = findFfBinary(name, { configuredMustExist: true });
|
|
17
|
-
if (!path) throw new Error(`${name} is required to analyze audio; run: npx hyperframes doctor`);
|
|
18
|
-
return path;
|
|
19
|
-
}
|
|
20
|
-
async function probeAudio(file) {
|
|
21
|
-
const { stdout } = await run(
|
|
22
|
-
requiredBinary("ffprobe"),
|
|
23
|
-
[
|
|
24
|
-
"-v",
|
|
25
|
-
"error",
|
|
26
|
-
"-select_streams",
|
|
27
|
-
"a:0",
|
|
28
|
-
"-show_streams",
|
|
29
|
-
"-show_format",
|
|
30
|
-
"-of",
|
|
31
|
-
"json",
|
|
32
|
-
"--",
|
|
33
|
-
file
|
|
34
|
-
],
|
|
35
|
-
{ maxBuffer: 8 * 1024 * 1024, windowsHide: true }
|
|
36
|
-
);
|
|
37
|
-
const parsed = JSON.parse(stdout);
|
|
38
|
-
const stream = parsed.streams?.[0];
|
|
39
|
-
if (!stream) return null;
|
|
40
|
-
return {
|
|
41
|
-
sampleRate: Number(stream.sample_rate),
|
|
42
|
-
channels: stream.channels ?? 1,
|
|
43
|
-
duration: Number(stream.duration ?? parsed.format?.duration ?? 0)
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
async function decodeAudio(file, window = {}, probed, format = {}) {
|
|
47
|
-
const probedInfo = probed ?? await probeAudio(file);
|
|
48
|
-
if (!probedInfo) return null;
|
|
49
|
-
const info = {
|
|
50
|
-
...probedInfo,
|
|
51
|
-
sampleRate: format.sampleRate ?? probedInfo.sampleRate,
|
|
52
|
-
channels: format.mono ? 1 : probedInfo.channels
|
|
53
|
-
};
|
|
54
|
-
const seek = window.from ? ["-ss", String(window.from)] : [];
|
|
55
|
-
const length = window.seconds === void 0 ? [] : ["-t", String(window.seconds)];
|
|
56
|
-
const { stdout } = await run(
|
|
57
|
-
requiredBinary("ffmpeg"),
|
|
58
|
-
[
|
|
59
|
-
"-v",
|
|
60
|
-
"error",
|
|
61
|
-
...seek,
|
|
62
|
-
"-i",
|
|
63
|
-
file,
|
|
64
|
-
...length,
|
|
65
|
-
"-map",
|
|
66
|
-
"0:a:0",
|
|
67
|
-
...format.mono ? ["-ac", "1"] : [],
|
|
68
|
-
...format.sampleRate ? ["-ar", String(format.sampleRate)] : [],
|
|
69
|
-
"-f",
|
|
70
|
-
"f32le",
|
|
71
|
-
"-acodec",
|
|
72
|
-
"pcm_f32le",
|
|
73
|
-
"-"
|
|
74
|
-
],
|
|
75
|
-
{ encoding: "buffer", maxBuffer: 2 * 1024 * 1024 * 1024, windowsHide: true }
|
|
76
|
-
);
|
|
77
|
-
const bytes = stdout.byteLength - stdout.byteLength % 4;
|
|
78
|
-
const interleaved = new Float32Array(
|
|
79
|
-
stdout.buffer.slice(stdout.byteOffset, stdout.byteOffset + bytes)
|
|
80
|
-
);
|
|
81
|
-
const frames = Math.floor(interleaved.length / info.channels);
|
|
82
|
-
const channels = Array.from({ length: info.channels }, (_, c) => {
|
|
83
|
-
const samples = new Float32Array(frames);
|
|
84
|
-
for (let i = 0; i < frames; i++) samples[i] = interleaved[i * info.channels + c];
|
|
85
|
-
return samples;
|
|
86
|
-
});
|
|
87
|
-
return { signal: { sampleRate: info.sampleRate, channels }, stream: info };
|
|
88
|
-
}
|
|
89
|
-
|
|
90
11
|
// ../core/dist/audioSteps.js
|
|
91
12
|
function finish(steps) {
|
|
92
13
|
for (; ; ) {
|
|
@@ -96,6 +17,43 @@ function finish(steps) {
|
|
|
96
17
|
}
|
|
97
18
|
}
|
|
98
19
|
|
|
20
|
+
// ../core/dist/fft.js
|
|
21
|
+
function fft(re, im) {
|
|
22
|
+
const n = re.length;
|
|
23
|
+
for (let i = 1, j = 0; i < n; i++) {
|
|
24
|
+
let bit = n >> 1;
|
|
25
|
+
for (; j & bit; bit >>= 1)
|
|
26
|
+
j ^= bit;
|
|
27
|
+
j ^= bit;
|
|
28
|
+
if (i < j) {
|
|
29
|
+
[re[i], re[j]] = [re[j], re[i]];
|
|
30
|
+
[im[i], im[j]] = [im[j], im[i]];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
for (let len = 2; len <= n; len <<= 1) {
|
|
34
|
+
const ang = -2 * Math.PI / len;
|
|
35
|
+
const wr = Math.cos(ang);
|
|
36
|
+
const wi = Math.sin(ang);
|
|
37
|
+
for (let i = 0; i < n; i += len) {
|
|
38
|
+
let cr = 1;
|
|
39
|
+
let ci = 0;
|
|
40
|
+
for (let k = 0; k < len / 2; k++) {
|
|
41
|
+
const ur = re[i + k];
|
|
42
|
+
const ui = im[i + k];
|
|
43
|
+
const vr = re[i + k + len / 2] * cr - im[i + k + len / 2] * ci;
|
|
44
|
+
const vi = re[i + k + len / 2] * ci + im[i + k + len / 2] * cr;
|
|
45
|
+
re[i + k] = ur + vr;
|
|
46
|
+
im[i + k] = ui + vi;
|
|
47
|
+
re[i + k + len / 2] = ur - vr;
|
|
48
|
+
im[i + k + len / 2] = ui - vi;
|
|
49
|
+
const ncr = cr * wr - ci * wi;
|
|
50
|
+
ci = cr * wi + ci * wr;
|
|
51
|
+
cr = ncr;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
99
57
|
// ../core/dist/audioResample.js
|
|
100
58
|
var ZERO_CROSSINGS = 8;
|
|
101
59
|
var STEPS_PER_CROSSING = 256;
|
|
@@ -136,43 +94,6 @@ function* resampleSteps(samples, from, to) {
|
|
|
136
94
|
return out;
|
|
137
95
|
}
|
|
138
96
|
|
|
139
|
-
// ../core/dist/fft.js
|
|
140
|
-
function fft(re, im) {
|
|
141
|
-
const n = re.length;
|
|
142
|
-
for (let i = 1, j = 0; i < n; i++) {
|
|
143
|
-
let bit = n >> 1;
|
|
144
|
-
for (; j & bit; bit >>= 1)
|
|
145
|
-
j ^= bit;
|
|
146
|
-
j ^= bit;
|
|
147
|
-
if (i < j) {
|
|
148
|
-
[re[i], re[j]] = [re[j], re[i]];
|
|
149
|
-
[im[i], im[j]] = [im[j], im[i]];
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
for (let len = 2; len <= n; len <<= 1) {
|
|
153
|
-
const ang = -2 * Math.PI / len;
|
|
154
|
-
const wr = Math.cos(ang);
|
|
155
|
-
const wi = Math.sin(ang);
|
|
156
|
-
for (let i = 0; i < n; i += len) {
|
|
157
|
-
let cr = 1;
|
|
158
|
-
let ci = 0;
|
|
159
|
-
for (let k = 0; k < len / 2; k++) {
|
|
160
|
-
const ur = re[i + k];
|
|
161
|
-
const ui = im[i + k];
|
|
162
|
-
const vr = re[i + k + len / 2] * cr - im[i + k + len / 2] * ci;
|
|
163
|
-
const vi = re[i + k + len / 2] * ci + im[i + k + len / 2] * cr;
|
|
164
|
-
re[i + k] = ur + vr;
|
|
165
|
-
im[i + k] = ui + vi;
|
|
166
|
-
re[i + k + len / 2] = ur - vr;
|
|
167
|
-
im[i + k + len / 2] = ui - vi;
|
|
168
|
-
const ncr = cr * wr - ci * wi;
|
|
169
|
-
ci = cr * wi + ci * wr;
|
|
170
|
-
cr = ncr;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
97
|
// ../core/dist/audioRhythm.js
|
|
177
98
|
var ANALYSIS_RATE = 22050;
|
|
178
99
|
var FRAME_SIZE = 1024;
|
|
@@ -560,73 +481,6 @@ function* rhythmSteps(signal) {
|
|
|
560
481
|
return entry.rhythm;
|
|
561
482
|
}
|
|
562
483
|
|
|
563
|
-
// ../core/dist/audioAnalysisLadder.js
|
|
564
|
-
function defaultLadder(capability, providers) {
|
|
565
|
-
return providers.filter((p) => p.capabilities.includes(capability)).map((p) => p.id);
|
|
566
|
-
}
|
|
567
|
-
function exclusion(provider, quality) {
|
|
568
|
-
if (quality === "fast" && !provider.signal)
|
|
569
|
-
return "quality fast allows signal processing only";
|
|
570
|
-
if (quality === "local" && !provider.local)
|
|
571
|
-
return "quality local keeps audio on this machine";
|
|
572
|
-
return null;
|
|
573
|
-
}
|
|
574
|
-
var message = (error) => error instanceof Error ? error.message : String(error);
|
|
575
|
-
async function availabilityOf(provider) {
|
|
576
|
-
try {
|
|
577
|
-
return provider.available ? await provider.available() : { ok: true };
|
|
578
|
-
} catch (error) {
|
|
579
|
-
return { ok: false, reason: message(error) };
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
async function blocked(id, candidate, capability, quality) {
|
|
583
|
-
if (!candidate?.capabilities.includes(capability))
|
|
584
|
-
return { provider: id, outcome: "unavailable", reason: `no provider ${id} for ${capability}` };
|
|
585
|
-
const excluded = exclusion(candidate, quality);
|
|
586
|
-
if (excluded)
|
|
587
|
-
return { provider: id, outcome: "excluded", reason: excluded };
|
|
588
|
-
const availability = await availabilityOf(candidate);
|
|
589
|
-
if (!availability.ok)
|
|
590
|
-
return { provider: id, outcome: "unavailable", reason: availability.reason };
|
|
591
|
-
return null;
|
|
592
|
-
}
|
|
593
|
-
function passedOver(capability, steps, answered) {
|
|
594
|
-
const skipped = steps.filter((s) => s.outcome === "unavailable" || s.outcome === "failed");
|
|
595
|
-
if (!skipped.length)
|
|
596
|
-
return null;
|
|
597
|
-
const why = skipped.map((s) => `${s.provider} ${s.outcome}${s.reason ? ` (${s.reason})` : ""}`).join("; ");
|
|
598
|
-
return answered ? `${capability}: used ${answered}; ${why}` : `${capability}: ${why}`;
|
|
599
|
-
}
|
|
600
|
-
async function runLadder(capability, input, providers, { quality = "best", ladder, provider, options = {} } = {}) {
|
|
601
|
-
const byId = new Map(providers.map((p) => [p.id, p]));
|
|
602
|
-
const order = provider ? [provider] : ladder ?? defaultLadder(capability, providers);
|
|
603
|
-
const steps = [];
|
|
604
|
-
for (const id of order) {
|
|
605
|
-
const candidate = byId.get(id);
|
|
606
|
-
const skip = await blocked(id, candidate, capability, quality);
|
|
607
|
-
if (skip) {
|
|
608
|
-
steps.push(skip);
|
|
609
|
-
continue;
|
|
610
|
-
}
|
|
611
|
-
try {
|
|
612
|
-
const value = await candidate.analyze(capability, input, options);
|
|
613
|
-
const warning = passedOver(capability, steps, id);
|
|
614
|
-
steps.push({ provider: id, outcome: "answered" });
|
|
615
|
-
return { value, provenance: id, steps, warnings: warning ? [warning] : [] };
|
|
616
|
-
} catch (error) {
|
|
617
|
-
steps.push({ provider: id, outcome: "failed", reason: message(error) });
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
const none = order.length ? "" : " (none offers it)";
|
|
621
|
-
const why = passedOver(capability, steps, null)?.slice(capability.length + 2);
|
|
622
|
-
return {
|
|
623
|
-
value: null,
|
|
624
|
-
provenance: null,
|
|
625
|
-
steps,
|
|
626
|
-
warnings: [`${capability}: no provider answered${none}${why ? `; ${why}` : ""}`]
|
|
627
|
-
};
|
|
628
|
-
}
|
|
629
|
-
|
|
630
484
|
// ../core/dist/audioSnap.js
|
|
631
485
|
function nearestIndex(sorted, t) {
|
|
632
486
|
let low = 0;
|
|
@@ -772,6 +626,73 @@ function sections(signal, options = {}) {
|
|
|
772
626
|
};
|
|
773
627
|
}
|
|
774
628
|
|
|
629
|
+
// ../core/dist/audioAnalysisLadder.js
|
|
630
|
+
function defaultLadder(capability, providers) {
|
|
631
|
+
return providers.filter((p) => p.capabilities.includes(capability)).map((p) => p.id);
|
|
632
|
+
}
|
|
633
|
+
function exclusion(provider, quality) {
|
|
634
|
+
if (quality === "fast" && !provider.signal)
|
|
635
|
+
return "quality fast allows signal processing only";
|
|
636
|
+
if (quality === "local" && !provider.local)
|
|
637
|
+
return "quality local keeps audio on this machine";
|
|
638
|
+
return null;
|
|
639
|
+
}
|
|
640
|
+
var message = (error) => error instanceof Error ? error.message : String(error);
|
|
641
|
+
async function availabilityOf(provider) {
|
|
642
|
+
try {
|
|
643
|
+
return provider.available ? await provider.available() : { ok: true };
|
|
644
|
+
} catch (error) {
|
|
645
|
+
return { ok: false, reason: message(error) };
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
async function blocked(id, candidate, capability, quality) {
|
|
649
|
+
if (!candidate?.capabilities.includes(capability))
|
|
650
|
+
return { provider: id, outcome: "unavailable", reason: `no provider ${id} for ${capability}` };
|
|
651
|
+
const excluded = exclusion(candidate, quality);
|
|
652
|
+
if (excluded)
|
|
653
|
+
return { provider: id, outcome: "excluded", reason: excluded };
|
|
654
|
+
const availability = await availabilityOf(candidate);
|
|
655
|
+
if (!availability.ok)
|
|
656
|
+
return { provider: id, outcome: "unavailable", reason: availability.reason };
|
|
657
|
+
return null;
|
|
658
|
+
}
|
|
659
|
+
function passedOver(capability, steps, answered) {
|
|
660
|
+
const skipped = steps.filter((s) => s.outcome === "unavailable" || s.outcome === "failed");
|
|
661
|
+
if (!skipped.length)
|
|
662
|
+
return null;
|
|
663
|
+
const why = skipped.map((s) => `${s.provider} ${s.outcome}${s.reason ? ` (${s.reason})` : ""}`).join("; ");
|
|
664
|
+
return answered ? `${capability}: used ${answered}; ${why}` : `${capability}: ${why}`;
|
|
665
|
+
}
|
|
666
|
+
async function runLadder(capability, input, providers, { quality = "best", ladder, provider, options = {} } = {}) {
|
|
667
|
+
const byId = new Map(providers.map((p) => [p.id, p]));
|
|
668
|
+
const order = provider ? [provider] : ladder ?? defaultLadder(capability, providers);
|
|
669
|
+
const steps = [];
|
|
670
|
+
for (const id of order) {
|
|
671
|
+
const candidate = byId.get(id);
|
|
672
|
+
const skip = await blocked(id, candidate, capability, quality);
|
|
673
|
+
if (skip) {
|
|
674
|
+
steps.push(skip);
|
|
675
|
+
continue;
|
|
676
|
+
}
|
|
677
|
+
try {
|
|
678
|
+
const value = await candidate.analyze(capability, input, options);
|
|
679
|
+
const warning = passedOver(capability, steps, id);
|
|
680
|
+
steps.push({ provider: id, outcome: "answered" });
|
|
681
|
+
return { value, provenance: id, steps, warnings: warning ? [warning] : [] };
|
|
682
|
+
} catch (error) {
|
|
683
|
+
steps.push({ provider: id, outcome: "failed", reason: message(error) });
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
const none = order.length ? "" : " (none offers it)";
|
|
687
|
+
const why = passedOver(capability, steps, null)?.slice(capability.length + 2);
|
|
688
|
+
return {
|
|
689
|
+
value: null,
|
|
690
|
+
provenance: null,
|
|
691
|
+
steps,
|
|
692
|
+
warnings: [`${capability}: no provider answered${none}${why ? `; ${why}` : ""}`]
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
|
|
775
696
|
// ../core/dist/audioAnalysis.js
|
|
776
697
|
var DB_FLOOR = -120;
|
|
777
698
|
var signalDuration = (signal) => (signal.channels[0]?.length ?? 0) / signal.sampleRate;
|
|
@@ -1207,6 +1128,85 @@ var signalProvider = {
|
|
|
1207
1128
|
}
|
|
1208
1129
|
};
|
|
1209
1130
|
|
|
1131
|
+
// src/audio/analysis/decode.ts
|
|
1132
|
+
import { execFile } from "child_process";
|
|
1133
|
+
import { promisify } from "util";
|
|
1134
|
+
var run = promisify(execFile);
|
|
1135
|
+
function requiredBinary(name) {
|
|
1136
|
+
const path = findFfBinary(name, { configuredMustExist: true });
|
|
1137
|
+
if (!path) throw new Error(`${name} is required to analyze audio; run: npx hyperframes doctor`);
|
|
1138
|
+
return path;
|
|
1139
|
+
}
|
|
1140
|
+
async function probeAudio(file) {
|
|
1141
|
+
const { stdout } = await run(
|
|
1142
|
+
requiredBinary("ffprobe"),
|
|
1143
|
+
[
|
|
1144
|
+
"-v",
|
|
1145
|
+
"error",
|
|
1146
|
+
"-select_streams",
|
|
1147
|
+
"a:0",
|
|
1148
|
+
"-show_streams",
|
|
1149
|
+
"-show_format",
|
|
1150
|
+
"-of",
|
|
1151
|
+
"json",
|
|
1152
|
+
"--",
|
|
1153
|
+
file
|
|
1154
|
+
],
|
|
1155
|
+
{ maxBuffer: 8 * 1024 * 1024, windowsHide: true }
|
|
1156
|
+
);
|
|
1157
|
+
const parsed = JSON.parse(stdout);
|
|
1158
|
+
const stream = parsed.streams?.[0];
|
|
1159
|
+
if (!stream) return null;
|
|
1160
|
+
return {
|
|
1161
|
+
sampleRate: Number(stream.sample_rate),
|
|
1162
|
+
channels: stream.channels ?? 1,
|
|
1163
|
+
duration: Number(stream.duration ?? parsed.format?.duration ?? 0)
|
|
1164
|
+
};
|
|
1165
|
+
}
|
|
1166
|
+
async function decodeAudio(file, window = {}, probed, format = {}) {
|
|
1167
|
+
const probedInfo = probed ?? await probeAudio(file);
|
|
1168
|
+
if (!probedInfo) return null;
|
|
1169
|
+
const info = {
|
|
1170
|
+
...probedInfo,
|
|
1171
|
+
sampleRate: format.sampleRate ?? probedInfo.sampleRate,
|
|
1172
|
+
channels: format.mono ? 1 : probedInfo.channels
|
|
1173
|
+
};
|
|
1174
|
+
const seek = window.from ? ["-ss", String(window.from)] : [];
|
|
1175
|
+
const length = window.seconds === void 0 ? [] : ["-t", String(window.seconds)];
|
|
1176
|
+
const { stdout } = await run(
|
|
1177
|
+
requiredBinary("ffmpeg"),
|
|
1178
|
+
[
|
|
1179
|
+
"-v",
|
|
1180
|
+
"error",
|
|
1181
|
+
...seek,
|
|
1182
|
+
"-i",
|
|
1183
|
+
file,
|
|
1184
|
+
...length,
|
|
1185
|
+
"-map",
|
|
1186
|
+
"0:a:0",
|
|
1187
|
+
...format.mono ? ["-ac", "1"] : [],
|
|
1188
|
+
...format.sampleRate ? ["-ar", String(format.sampleRate)] : [],
|
|
1189
|
+
"-f",
|
|
1190
|
+
"f32le",
|
|
1191
|
+
"-acodec",
|
|
1192
|
+
"pcm_f32le",
|
|
1193
|
+
"-"
|
|
1194
|
+
],
|
|
1195
|
+
{ encoding: "buffer", maxBuffer: 2 * 1024 * 1024 * 1024, windowsHide: true }
|
|
1196
|
+
);
|
|
1197
|
+
const bytes = stdout.byteLength - stdout.byteLength % 4;
|
|
1198
|
+
const interleaved = new Float32Array(
|
|
1199
|
+
stdout.buffer.slice(stdout.byteOffset, stdout.byteOffset + bytes)
|
|
1200
|
+
);
|
|
1201
|
+
const frames = Math.floor(interleaved.length / info.channels);
|
|
1202
|
+
const channels = Array.from({ length: info.channels }, (_, c) => {
|
|
1203
|
+
const samples = new Float32Array(frames);
|
|
1204
|
+
for (let i = 0; i < frames; i++) samples[i] = interleaved[i * info.channels + c];
|
|
1205
|
+
return samples;
|
|
1206
|
+
});
|
|
1207
|
+
return { signal: { sampleRate: info.sampleRate, channels }, stream: info };
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
1210
|
export {
|
|
1211
1211
|
finish,
|
|
1212
1212
|
medianInterval,
|
|
@@ -1219,6 +1219,7 @@ export {
|
|
|
1219
1219
|
signalDuration,
|
|
1220
1220
|
energyMixSteps,
|
|
1221
1221
|
envelope,
|
|
1222
|
+
silence,
|
|
1222
1223
|
signalProvider,
|
|
1223
1224
|
probeAudio,
|
|
1224
1225
|
decodeAudio
|