diff --git a/skills-manifest.json b/skills-manifest.json index bdb2800855..622eed2495 100644 --- a/skills-manifest.json +++ b/skills-manifest.json @@ -18,8 +18,8 @@ "files": 13 }, "media-use": { - "hash": "d4221a4cd4118c29", - "files": 120 + "hash": "d28e54e57fce04d9", + "files": 122 }, "remotion-to-hyperframes": { "hash": "73b82d19db2ed8c9", @@ -34,7 +34,7 @@ "files": 2 }, "style-sampling": { - "hash": "dcd3765bed6b5c77", + "hash": "278b90cfc24dcfa1", "files": 2 } } diff --git a/skills/media-use/audio/scripts/audio.mjs b/skills/media-use/audio/scripts/audio.mjs index e86c17a5dd..3d7a96badf 100644 --- a/skills/media-use/audio/scripts/audio.mjs +++ b/skills/media-use/audio/scripts/audio.mjs @@ -26,7 +26,7 @@ // } // // ── audio_meta.json (output, id-keyed) ─────────────────────────────────────── -// { tts_provider, voice_id, +// { tts_provider, voice_id, voice_credit, // bgm: { path, volume, mode, query?, duration_s? } | null, // bgm_pending, bgm_provider, bgm_pid, bgm_log, bgm_mode, bgm_target_duration_s, …, // voices: [ { id, path, duration_s, words: [{id,text,start,end}] } ], @@ -52,6 +52,7 @@ import { } from "./lib/tts.mjs"; import { generateBgmDetached, inferBgmPrompt, retrieveBgm } from "./lib/bgm.mjs"; import { BUNDLED_SFX_DIR, resolveSfx } from "./lib/sfx.mjs"; +import { voiceCredit } from "./lib/voice-credit.mjs"; import { parseWords, scaleWords, stretchToWav } from "./lib/recording.mjs"; import { mapWithConcurrency } from "./lib/concurrency.mjs"; import { openAudioMeta } from "./lib/audio-meta.mjs"; @@ -315,6 +316,7 @@ if (only.has("sfx")) { const meta = { tts_provider: ttsProvider, voice_id: voiceId, + voice_credit: voiceCredit(voices, ttsProvider), bgm, ...bgmFields, voices, diff --git a/skills/media-use/audio/scripts/lib/voice-credit.mjs b/skills/media-use/audio/scripts/lib/voice-credit.mjs new file mode 100644 index 0000000000..8adf3e6272 --- /dev/null +++ b/skills/media-use/audio/scripts/lib/voice-credit.mjs @@ -0,0 +1,17 @@ +// voice-credit.mjs — the credits line for a run's voices, naming where each voice really came from. +const VENDORS = { + heygen: "HeyGen", + elevenlabs: "ElevenLabs", + gemini: "Google Gemini", + kokoro: "Kokoro (open-source, run locally)", +}; + +/** "Voice: ..." for the voices an audio run made or took in, or null when it has none. */ +export function voiceCredit(voices, ttsProvider) { + const sources = new Set(voices.map((v) => v.source ?? ttsProvider).filter(Boolean)); + if (sources.size === 0) return null; + const parts = [...sources].map((s) => + s === "recording" ? "your own recording" : `AI-generated by ${VENDORS[s] ?? s}`, + ); + return `Voice: ${parts.join("; ")}`; +} diff --git a/skills/media-use/audio/scripts/lib/voice-credit.test.mjs b/skills/media-use/audio/scripts/lib/voice-credit.test.mjs new file mode 100644 index 0000000000..f6f79cf998 --- /dev/null +++ b/skills/media-use/audio/scripts/lib/voice-credit.test.mjs @@ -0,0 +1,21 @@ +import { test } from "node:test"; +import assert from "node:assert/strict"; +import { voiceCredit } from "./voice-credit.mjs"; + +test("a generated voice is credited to the vendor that made it, not always HeyGen", () => { + assert.equal(voiceCredit([{ id: "01" }], "elevenlabs"), "Voice: AI-generated by ElevenLabs"); + assert.equal(voiceCredit([{ id: "01" }], "gemini"), "Voice: AI-generated by Google Gemini"); + assert.equal(voiceCredit([{ id: "01" }], "heygen"), "Voice: AI-generated by HeyGen"); +}); + +test("a recording is credited as the person's own, and a mix names both", () => { + assert.equal(voiceCredit([{ source: "recording" }], "recording"), "Voice: your own recording"); + assert.equal( + voiceCredit([{ source: "recording" }, { id: "02" }], "kokoro"), + "Voice: your own recording; AI-generated by Kokoro (open-source, run locally)", + ); +}); + +test("no voices, no credit", () => { + assert.equal(voiceCredit([], null), null); +}); diff --git a/skills/media-use/audio/scripts/recording.test.mjs b/skills/media-use/audio/scripts/recording.test.mjs index 0bce5d37ef..b78501a214 100644 --- a/skills/media-use/audio/scripts/recording.test.mjs +++ b/skills/media-use/audio/scripts/recording.test.mjs @@ -120,6 +120,7 @@ test("a recording at speed 2: the file is stretched and the words still land on const voice = meta.voices[0]; assert.equal(meta.tts_provider, "recording"); assert.equal(voice.source, "recording"); + assert.equal(meta.voice_credit, "Voice: your own recording"); assert.ok(Math.abs(voice.duration_s - 1) < 0.05, `duration ${voice.duration_s}`); assert.deepEqual([voice.words[0].start, voice.words[0].end], [0.5, 1]); const probe = spawnSync( diff --git a/skills/media-use/references/audio.md b/skills/media-use/references/audio.md index 5566dbc351..4a4df4ae81 100644 --- a/skills/media-use/references/audio.md +++ b/skills/media-use/references/audio.md @@ -12,7 +12,7 @@ node /audio/scripts/audio.mjs --request ./audio_request.json --out ./ - **Request** `{ provider?, voice?, lang?, speed?, tts_model?, style?, lines: [{ id, text, style?, sfx?: [names] }], bgm: { mode?, query?, prompt? } }`: `id` joins each line back to your model; `bgm.mode` = `retrieve | generate | none` (omit for auto). `--only tts,bgm,sfx` runs a subset and merges into an existing `--out`. - **Your own recording**: a line with `audio` (a path in the project) instead of `text` is used as the voice: `{ id, audio: "take.m4a", words?: [{ text, start, end }] }`. It is converted to `assets/voice/.wav`, `speed` stretches it with the pitch kept and scales `words` the same (without `words` the recording is transcribed). Its `audio_meta.json` voice has `source: "recording"`; with only recording lines `tts_provider` is `"recording"` and no provider or HeyGen sign-in is needed. - **Gemini narration** is opt-in with `provider: "gemini"` and an API key or service-account credentials. `tts_model` defaults to `gemini-3.8-flash-tts`; 3.8 Flash-Lite, 3.1 Flash Preview, and 2.5 Pro/Flash Preview TTS are also supported. `style` directs delivery; a line's style overrides the request's style. CLI overrides: `--tts-model`, `--style`. See `audio/references/tts.md` for a complete request. The existing automatic provider order is unchanged. -- **Output** `audio_meta.json` (id-keyed): `voices[].{path,duration_s,words[]}` (word timestamps for captions), `sfx[]`, `bgm`, `total_duration_s`. +- **Output** `audio_meta.json` (id-keyed): `voice_credit` (the credits line for the voices, naming where they really came from: your recording or the vendor; use it as is), `voices[].{path,duration_s,words[]}` (word timestamps for captions), `sfx[]`, `bgm`, `total_duration_s`. - **HeyGen free-usage path**: HeyGen CLI auth unlocks TTS plus music retrieval; SFX come from Openverse with no account (`audio/references/sfx.md`). Local/provider-specific generators are explicit alternatives where installed; run `npx hyperframes media-use resolve --doctor` before assuming retrieval or TTS will work. - If BGM took the generate path (`bgm_pending: true`), run `audio/scripts/wait-bgm.mjs` before final render. diff --git a/skills/style-sampling/references/remix.md b/skills/style-sampling/references/remix.md index ccc7315771..3e0e200d31 100644 --- a/skills/style-sampling/references/remix.md +++ b/skills/style-sampling/references/remix.md @@ -23,7 +23,7 @@ The person's message carries what it carries. Ask once, together, only what is s - **Never the creator's face, voice, footage, wordmark or show name.** That rule is about the creator: the person's own clone, their own recording or a credited stock voice are all fine. - **A presenter runs on the plan.** Their own HeyGen avatar if they have one (`npx hyperframes media-use avatars` lists the looks on the HyperFrames account making the film; never `heygen avatar list`, a separate sign-in that can be another account), otherwise Avatar IV from their photo, both through `npx hyperframes media-use generate --type avatar` with the finished voice, so the lips land on it. HeyGen Video 1 is the fallback when neither works. -- **Settle the voice before any research.** A HeyGen voice id the person gave, or an 8-character prefix of one, is used only when they say it is theirs, that its owner agreed to this film, or that it is a HeyGen stock voice. Having the id is not that, and an id missing from `npx hyperframes media-use voices` proves nothing (it lists one page), so when they have not said, ask it in the one round of questions. A prefix: find the full id in `npx hyperframes media-use voices --limit 100`, and ask when it matches none or several. A clone they name as theirs, or say its owner agreed to: find it there and use it. That list is every clone the HyperFrames account's workspace can use, a teammate's included, and does not say who made one, so never pick from it by count, language or name; never `heygen voice list`, a separate sign-in that can be another account. Nothing named, or not signed in: ask once for their voice id, a clone they make in HeyGen from 30 s to 3 min of their own reading, or their own recorded narration; with none of these, say in one line that you'll use a HeyGen stock voice, name it in the credits as AI-generated, and go on. Nothing is voiced for it before stop 1: at the voice step, `npx hyperframes media-use generate --type voice --voice --script "" --out .media/pick.mp3 --plan` names HeyGen's first public voice in that language without making anything; set the kit's voice id to its `voice_id` and credit that voice by name. Nothing else starts until this is settled. +- **Settle the voice before any research.** A HeyGen voice id the person gave, or an 8-character prefix of one, is used only when they say it is theirs, that its owner agreed to this film, or that it is a HeyGen stock voice. Having the id is not that, and an id missing from `npx hyperframes media-use voices` proves nothing (it lists one page), so when they have not said, ask it in the one round of questions. A prefix: find the full id in `npx hyperframes media-use voices --limit 100`, and ask when it matches none or several. A clone they name as theirs, or say its owner agreed to: find it there and use it. That list is every clone the HyperFrames account's workspace can use, a teammate's included, and does not say who made one, so never pick from it by count, language or name; never `heygen voice list`, a separate sign-in that can be another account. Nothing named, or not signed in: ask once for their voice id, a clone they make in HeyGen from 30 s to 3 min of their own reading, or their own recorded narration; with none of these, say in one line that you'll use a HeyGen stock voice, credit it as AI-generated, and go on. The credits line for any voice, a recording or another vendor included, is `voice_credit` in the audio run's `audio_meta.json`. Nothing is voiced for it before stop 1: at the voice step, `npx hyperframes media-use generate --type voice --voice --script "" --out .media/pick.mp3 --plan` names HeyGen's first public voice in that language without making anything; set the kit's voice id to its `voice_id` and credit that voice by name. Nothing else starts until this is settled. - **Then say what's coming** in one short message that is not a question, and go on without waiting: the working title and hook, the length, and roughly how long it takes. No prices. - **The length is the person's, and it beats the template's runtime.** Offer about 1 minute first: the cold open, the title beat and one chapter, the end card short. 2 to 4 minutes: REMIX.md's short cut. A full episode: the series' own runtime. Their own words ("90 seconds", "5 min"): that length. No length answered and none in the topic: about 1 minute, and offer the longer cut in the reply. Scale everything to it: script words (the template's script stats at that runtime), facts, sections, music cues, review rounds (one for a minute, two for a full episode); never pad or trim to reach the series' runtime instead. - **Credits name only who the person names.** Roles and names come from the person, never from a voice list, an account or a placeholder; a role nobody named is left out.