Communitygithub.com

Manavv007/S.A.R.A.L.-方案访问检索分析层-

为 HyperFrames 合成作品生成音频和媒体资源,基于单一的音频引擎(`scripts/audio.mjs`),支持多提供商 TTS(HeyGen / ElevenLabs / Kokoro 本地)、背景音乐和音效(默认使用 HeyGen 音频库检索,本地 Lyria / MusicGen 背景音乐生成和内置音效库作为无凭据时的备选)、Whisper 转录、背景去除和字幕编辑。适用于画外音/ TTS、背景音乐、音效/音效、转录、字幕/副标题/歌词/卡拉 OK / 逐词样式、声音和提供商选择以及音乐情绪提示。

S.A.R.A.L.-方案访问检索分析层- 是什么?

该技能为 HyperFrames 提供一个统一的音频和媒体资产创建层,其核心是一个单一的脚本引擎(`scripts/audio.mjs`)。它通过一个标准化的 `audio_request.json` 输入和 `audio_meta.json` 输出来协调文本转语音(TTS)、背景音乐(BGM)、音效(SFX)、转录、字幕生成和背景去除。这种设计避免了分散的音频处理方式,确保了工作流程的一致性。该技能主要支持 HeyGen,允许通过其 API 进行 TTS、音乐和音效检索;如果 HeyGen 凭据不存在,它会智能降级到其他提供商:对于 TTS,依次尝试 ElevenLabs 和本地 Kokoro 模型;对于 BGM,使用本地 Lyria 或 MusicGen 进行生成;对于 SFX,则使用一个包含 21 个文件的本地库。一个关键特性是其对凭据状态的处理:它不会静默地默认使用本地引擎,而是始终提示用户进行身份验证(通过 `npx hyperframes auth`),并在继续之前等待明确的同意。该引擎原生支持 HeyGen 的基于时间戳的字词级输出,这对于逐字动画或卡拉 OK 效果至关重要,而对于其他 TTS 提供商,则需要链接转录步骤。该技能还涵盖全面的字幕创作,包括样式检测、布局、字词分组和动作效果,以及通过 Whisper 进行稳健的转录处理。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Manavv007/S.A.R.A.L.-Scheme-Access-Retrieval-Analysis-Layer-/tree/HEAD/data/skills/hyperframes-media

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

HyperFrames 媒体

为合成作品创建所需的音频和媒体资产——画外音(TTS)、背景音乐 + 音效、转录、字幕、背景去除——然后在 HTML 中消费和动画化这些数据。关于如何将资产放入合成作品中,请参阅 hyperframes-core。

音频引擎——TTS · BGM · SFX 的单一来源

工作流不会手动处理音频或复制供应商的副本。只有一个引擎——scripts/audio.mjs——它接受一个中立的 audio_request.json 并写入 audio_meta.json(以及 assets/voice|bgm|sfx 下的资产):

# <MEDIA_DIR> = 此技能的目录
node <MEDIA_DIR>/scripts/audio.mjs --request ./audio_request.json --hyperframes . --out ./audio_meta.json

所有三种能力都基于一个开关降级——是否存在 HeyGen 凭据(从 $HEYGEN_API_KEY / $HYPERFRAMES_API_KEY / ~/.heygen 解析,不是 CLI):

能力HeyGen 凭据存在不存在
TTSHeyGen Starfish REST(原生字词时间戳)→ ElevenLabs → Kokoro(链接 transcribe 获取字词)
BGMHeyGen 音乐检索Lyria → MusicGen 本地生成(分离运行)
SFXHeyGen 音效检索(min_score 0.4)捆绑的 21 文件库(assets/sfx/)
  • 请求(audio_request.json):{ provider?, lang?, speed?, lines: [{ id, text, sfx?: [names] }], bgm: { mode?, query?, prompt? } }。id 将每一行连接回调用者的模型(帧号、场景 ID 等)。bgm.mode = retrieve | generate | none;省略则为自动模式(有凭据时检索,否则生成)。显式的 retrieve 是严格的——它会跳过而不是启动一个分离的生成(适用于没有 wait-bgm 步骤的调用者)。
  • 输出(audio_meta.json,按 id 键控):{ tts_provider, voice_id, bgm, bgm_pending, …, voices: [{ id, path, duration_s, words }], sfx: [{ id, name, file, source, offset_s, duration_s, volume }], total_duration_s }。
  • --only tts,bgm,sfx 运行一个子集并将结果合并到现有的 --out 中(例如,先 TTS+BGM,一旦有了提示,再处理 SFX)。
  • BGM 生成是分离启动的(bgm_pending: true)——在组装前运行 scripts/wait-bgm.mjs。
  • scripts/heygen-tts.mjs 是一个基于相同代码的单次 CLI(一段文本 → wav + 字词),适用于你只需要 HeyGen TTS 而无需请求文件的情况。

完整标志列表和 audio_meta.json 模式位于 scripts/audio.mjs 的头部。下面的参考资料涵盖了每种能力背后的提供商细节和边界情况。

预检——在任何音频之前显示登录状态

在生成语音或 BGM 之前始终运行此步骤——无论是在完整工作流中,还是在一次性的“为我生成 BGM/画外音”请求中。 没有 HeyGen 凭据不是静默回退到本地引擎的理由:首先建议登录,让用户决定。运行共享预检并原样传递其输出——不要自己编造“缺少密钥”的提示,也不要提供将密钥写入每个仓库的 .env 文件中:

npx hyperframes auth status
  • 已登录 → 它将打印账户信息;继续。
  • 未登录(这里预期 exit 1——“未登录”是正常状态,不是失败)→ 它将打印注册优先的指导。建议登录:npx hyperframes auth login 是浏览器 OAuth——它登录并创建一个账户(始终可通过此仓库的 CLI 使用)。要使用现有的 HeyGen API 密钥(来自 app.heygen.com/settings/api),运行 npx hyperframes auth login --api-key——它会保存到共享的 ~/.heygen(无需每个仓库的 .env)。输出还会列出本地引擎的语音/BGM 将回退到的提供商,以及当依赖项缺失时的 pip 提示。原样传递此输出——不要用你自己的措辞改写它。 然后停止并等待用户选择——登录,或说“go”/“local”以继续离线模式——在生成任何内容之前。 这是一个真实的决策点,而不是一个简单的说明:不要把它折叠到另一个问题中,也不要自己越过它。(例外:在自主/非交互模式下,记录状态并继续离线。)
  • npx hyperframes auth status --json 返回 { configured, recommended_action, offline_engines },用于确定性分支。
  • 如果 CLI 无法运行(不在 PATH 上且 npx 无法获取)→ 仍然建议登录(npx hyperframes auth login)并停止等待用户选择——不要将“没有凭据”视为本地生成的静默绿灯。

凭据解析、完整密钥优先级和本地依赖列表位于 references/requirements.md 中。

提供商链(引擎背后的细节)

TTS——第一个可用的提供商获胜(引擎,或 npx hyperframes tts "..."):

顺序提供商检测时机字词时间戳
1HeyGen(Starfish)$HEYGEN_API_KEY / hyperframes auth login是,原生——传递 --words narration.words.json 以捕获
2ElevenLabs设置 $ELEVENLABS_API_KEY否——之后链接 transcribe
3Kokoro-82M(本地,54 种声音)始终可用(无需密钥)否——之后链接 transcribe

发布的 hyperframes tts CLI 通常是仅本地的构建版本(其 --help 显示“Kokoro-82M”,没有 --provider/--words),即使设置了 $HEYGEN_API_KEY 也会静默回退到 Kokoro。这就是为什么引擎的 HeyGen 路径是自包含的 scripts/heygen-tts.mjs(REST),而不是 CLI;CLI 仅用于 Kokoro 路径。请参阅 references/tts.md。

BGM & SFX——默认从 HeyGen 音频库检索(/v3/audio/sounds),凭据与 HeyGen TTS 相同,无凭据时回退到上述开关:

资产HeyGen type存放位置回退(无凭据)
BGMmusicassets/bgm/track.mp3(检索)· track.wav(生成)Lyria / MusicGen 生成
SFXsound_effects(min_score 0.4)assets/sfx/<slug>.mp3捆绑的 21 文件库(assets/sfx/* + manifest.json)

请参阅 references/bgm.md 和 references/sfx.md。

路由

任务阅读
音频引擎——请求/元数据模式,--only,开关scripts/audio.mjs(头部注释)
npx hyperframes tts / heygen-tts.mjs——提供商、声音、字词references/tts.md
BGM——HeyGen 检索 + 本地 Lyria / MusicGen 生成references/bgm.md
SFX——HeyGen 检索(min_score 0.4)+ 捆绑的本地库references/sfx.md
npx hyperframes transcribe——Whisper,模型规则,输出形状references/transcribe.md
npx hyperframes remove-background——透明剪切references/remove-background.md
TTS → 转录 → 字幕(无需录制的画外音)references/tts-to-captions.md
字幕编辑——样式检测、布局、字词分组、退出references/captions/authoring.md
转录处理——输入格式、质量门、清理、APIreferences/captions/transcript-handling.md
字幕动画——卡拉 OK、标记效果、音频反应式references/captions/motion.md
模型缓存、系统依赖项、故障排除references/requirements.md

不可协商的规则

  • 一个引擎,无供应商副本。 通过 scripts/audio.mjs(或 heygen-tts.mjs 用于一次性 HeyGen TTS)生成音频。不要在工作流中重新实现 TTS/BGM/SFX——编写一个 audio_request.json 适配器并调用引擎。
  • "HeyGen 可用" = 可解析的凭据,而不是 CLI。 整个开关以 heygenCredential() 为键控;发布的 hyperframes tts 可能只是 Kokoro 版本,而且根本没有 hyperframes bgm / hyperframes sfx 命令。
  • 语音 ID 是特定于提供商的。 am_michael 仅适用于 Kokoro;HeyGen UUID 在 Kokoro 上不起作用。如果你传递 --voice,也要固定 --provider 以避免当用户的环境发生变化时出现无声的提供商漂移。
  • 始终向 transcribe 传递 --model。 CLI 默认的 small.en 会静默翻译非英语音频。请参阅 references/transcribe.md → "语言规则"。
  • HeyGen 返回字词时间戳;ElevenLabs / Kokoro 不返回。 引擎会自动为后两者链接触发 transcribe;独立使用时,向 HeyGen 传递 --words 或对音频文件运行 transcribe。
  • 字幕使用扁平的字词数组格式,包含 { id, text, start, end }。请参阅 references/transcribe.md → "输出形状"。
  • remove-background --background-output 是抠洞,不是内补。 对于“没有人的场景”,需要使用不同的工具。请参阅 references/remove-background.md → "何时不是合适的工具"。
  • BGM/SFX 默认使用 HeyGen 检索;无凭据时回退到生成(BGM)或捆绑库(SFX)。 /audio/sounds 按文本查询排序——具体命名效果(glass shatter,而不是 dramatic sound);无匹配则跳过,从不阻塞渲染。SFX 在语音 + BGM 下的音量约为 0.35。请参阅 references/sfx.md / references/bgm.md。
  • 将工作流字幕 HTML 视为生成的输出。 对于基于预设的视频,可重复使用的皮肤源位于 .hyperframes/caption-skin.html,工作流脚本写入 compositions/captions.html;不要编辑生成的 compositions/captions.html 来修复皮肤。通过工作流的 captions.mjs 重新构建,或在工作流存在时使用其显式覆盖机制。

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

Manavv007/S.A.R.A.L.-Scheme-Access-Retrieval-Analysis-Layer-

The fallback workflow for authoring custom HyperFrames video compositions at any length or format — longer or multi-scene pieces, brand / sizzle reels, montages, title cards, static loops, and freeform compositions. Input- and length-agnostic. If a specialized workflow clearly fits the input — a marketed product, a website, a topic explainer, a GitHub PR, existing footage, a short motion graphic, or a Remotion port — prefer it (see /hyperframes); use this only as the general fallback when none fit.

Manavv007/S.A.R.A.L.-Scheme-Access-Retrieval-Analysis-Layer-

All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). HyperFrames-native: single paused timeline, seek-safe, deterministic.

Manavv007/S.A.R.A.L.-Scheme-Access-Retrieval-Analysis-Layer-

HyperFrames CLI dev loop. Use when running npx hyperframes init, add, catalog, capture, lint, validate, inspect, layout, snapshot, preview, play, render, publish, lambda, doctor, browser, info, upgrade, skills, compositions, docs, benchmark, telemetry, transcribe, tts, or remove-background, or when troubleshooting the HyperFrames build/render environment. Entry point for AWS Lambda cloud rendering (`hyperframes lambda deploy / render / progress / destroy / policies`).

Manavv007/S.A.R.A.L.-Scheme-Access-Retrieval-Analysis-Layer-

The HyperFrames composition contract — build one renderable project. Use for composition structure, the `data-*` timing attributes, `class="clip"`, tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.

Manavv007/S.A.R.A.L.-Scheme-Access-Retrieval-Analysis-Layer-

Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use `hyperframes-animation`.

Manavv007/S.A.R.A.L.-Scheme-Access-Retrieval-Analysis-Layer-

Capture a general website/URL and turn it into a HyperFrames video (site tour, showcase, or social clip from the site's own visuals). Uses headless Chrome screenshots + brand assets. Use when intent is general — portfolio/blog/landing-page showcase or social clip from the site. NOT for: product/SaaS launch or promo (→ /product-launch-video, even from a URL); topic explainer with no site (→ /faceless-explainer); GitHub PR (→ /pr-to-video); adding captions to existing video (→ /embedded-captions); short unnarrated page-highlight motion graphic (→ /motion-graphics). Unclear launch-vs-general-site? Ask one question or start at /hyperframes.

Manavv007/S.A.R.A.L.-Scheme-Access-Retrieval-Analysis-Layer-

S.A.R.A.L. is an advanced AI-powered platform designed to bridge the "information gap" between rural Indian citizens and government welfare. While thousands of schemes exist, the complex language of official PDFs often makes them inaccessible to the common man.

相关技能