Communitygithub.com

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

為 HyperFrames 作品提供音訊與媒體素材,由單一音訊引擎 (`scripts/audio.mjs`) 驅動——支援多供應商 TTS(HeyGen / ElevenLabs / Kokoro 本地)、背景音樂與音效(預設 HeyGen 音訊庫檢索,搭配本地 Lyria / MusicGen BGM 生成及內建音效庫作為無憑證時的備援)、Whisper 轉錄、去背及字幕編寫。適用於旁白/TTS、BGM、音效/SFX、轉錄、字幕/歌詞/KTV/逐字樣式、語音與供應商選取以及音樂情緒提示。

S.A.R.A.L.-Scheme-Access-Retrieval-Analysis-Layer- 是什麼?

此技能為 HyperFrames 作品提供統一的音訊與媒體資產生成管道,核心是單一的 `scripts/audio.mjs` 引擎。它能處理旁白(文字轉語音 TTS)、背景音樂(BGM)、音效(SFX)、語音轉錄、字幕編寫以及背景移除。其設計核心在於智慧型的供應商切換邏輯:當偵測到 HeyGen 憑證時,會優先使用 HeyGen 雲端服務(TTS 提供原生逐字時間戳、BGM/SFX 從其音訊庫檢索);當無憑證時,會自動降級至本地引擎(TTS 使用 Kokoro、BGM 使用 Lyria/MusicGen 生成、SFX 使用內建的 21 個音效檔案庫)。此技能特別強調執行前的預檢流程,要求先執行 `npx hyperframes auth status` 顯示登入狀態,並在無憑證時提示使用者選擇登入或離線執行,避免靜默降級導致非預期行為。輸出為結構化的 `audio_meta.json`,可被 HyperFrames 核心或其他工作流程消費,並支援增量合併(使用 `--only` 參數)及背景任務(如 BGM 生成),提供靈活的非同步處理能力。支援平台包括 HyperFrames CLI 及 Node.js 環境。

相容平台~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 Media

為作品建立所需的音訊與媒體資產——旁白(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 提示。逐字轉達此輸出,不要用自己的話改寫。 然後停止並等待使用者選擇——登入,或說「繼續」/「本地」以離線繼續——在生成任何內容之前。 這是一個真實的決策點,不是一個附帶說明:不要將其併入另一個問題,也不要自行跳過。(例外:在自動/非互動模式下,記錄狀態並以離線方式繼續。)
  • 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,以避免因使用者環境變更而導致供應商靜默漂移。
  • 務必傳遞 --model 給 transcribe。 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 根據文字查詢排序——請具體命名效果(玻璃碎裂,而非戲劇性音效);無匹配時跳過,絕不阻擋渲染。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.

相關技能