Skip to content

Commit f5bde95

Browse files
feat(media-use): the voice credits line names the real source, your recording or any vendor (heygen-com#7380)
1 parent 57a7533 commit f5bde95

7 files changed

Lines changed: 47 additions & 6 deletions

File tree

‎skills-manifest.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"files": 13
1919
},
2020
"media-use": {
21-
"hash": "d4221a4cd4118c29",
22-
"files": 120
21+
"hash": "d28e54e57fce04d9",
22+
"files": 122
2323
},
2424
"remotion-to-hyperframes": {
2525
"hash": "73b82d19db2ed8c9",
@@ -34,7 +34,7 @@
3434
"files": 2
3535
},
3636
"style-sampling": {
37-
"hash": "dcd3765bed6b5c77",
37+
"hash": "278b90cfc24dcfa1",
3838
"files": 2
3939
}
4040
}

‎skills/media-use/audio/scripts/audio.mjs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// }
2727
//
2828
// ── audio_meta.json (output, id-keyed) ───────────────────────────────────────
29-
// { tts_provider, voice_id,
29+
// { tts_provider, voice_id, voice_credit,
3030
// bgm: { path, volume, mode, query?, duration_s? } | null,
3131
// bgm_pending, bgm_provider, bgm_pid, bgm_log, bgm_mode, bgm_target_duration_s, …,
3232
// voices: [ { id, path, duration_s, words: [{id,text,start,end}] } ],
@@ -52,6 +52,7 @@ import {
5252
} from "./lib/tts.mjs";
5353
import { generateBgmDetached, inferBgmPrompt, retrieveBgm } from "./lib/bgm.mjs";
5454
import { BUNDLED_SFX_DIR, resolveSfx } from "./lib/sfx.mjs";
55+
import { voiceCredit } from "./lib/voice-credit.mjs";
5556
import { parseWords, scaleWords, stretchToWav } from "./lib/recording.mjs";
5657
import { mapWithConcurrency } from "./lib/concurrency.mjs";
5758
import { openAudioMeta } from "./lib/audio-meta.mjs";
@@ -315,6 +316,7 @@ if (only.has("sfx")) {
315316
const meta = {
316317
tts_provider: ttsProvider,
317318
voice_id: voiceId,
319+
voice_credit: voiceCredit(voices, ttsProvider),
318320
bgm,
319321
...bgmFields,
320322
voices,
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// voice-credit.mjs — the credits line for a run's voices, naming where each voice really came from.
2+
const VENDORS = {
3+
heygen: "HeyGen",
4+
elevenlabs: "ElevenLabs",
5+
gemini: "Google Gemini",
6+
kokoro: "Kokoro (open-source, run locally)",
7+
};
8+
9+
/** "Voice: ..." for the voices an audio run made or took in, or null when it has none. */
10+
export function voiceCredit(voices, ttsProvider) {
11+
const sources = new Set(voices.map((v) => v.source ?? ttsProvider).filter(Boolean));
12+
if (sources.size === 0) return null;
13+
const parts = [...sources].map((s) =>
14+
s === "recording" ? "your own recording" : `AI-generated by ${VENDORS[s] ?? s}`,
15+
);
16+
return `Voice: ${parts.join("; ")}`;
17+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { test } from "node:test";
2+
import assert from "node:assert/strict";
3+
import { voiceCredit } from "./voice-credit.mjs";
4+
5+
test("a generated voice is credited to the vendor that made it, not always HeyGen", () => {
6+
assert.equal(voiceCredit([{ id: "01" }], "elevenlabs"), "Voice: AI-generated by ElevenLabs");
7+
assert.equal(voiceCredit([{ id: "01" }], "gemini"), "Voice: AI-generated by Google Gemini");
8+
assert.equal(voiceCredit([{ id: "01" }], "heygen"), "Voice: AI-generated by HeyGen");
9+
});
10+
11+
test("a recording is credited as the person's own, and a mix names both", () => {
12+
assert.equal(voiceCredit([{ source: "recording" }], "recording"), "Voice: your own recording");
13+
assert.equal(
14+
voiceCredit([{ source: "recording" }, { id: "02" }], "kokoro"),
15+
"Voice: your own recording; AI-generated by Kokoro (open-source, run locally)",
16+
);
17+
});
18+
19+
test("no voices, no credit", () => {
20+
assert.equal(voiceCredit([], null), null);
21+
});

‎skills/media-use/audio/scripts/recording.test.mjs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ test("a recording at speed 2: the file is stretched and the words still land on
120120
const voice = meta.voices[0];
121121
assert.equal(meta.tts_provider, "recording");
122122
assert.equal(voice.source, "recording");
123+
assert.equal(meta.voice_credit, "Voice: your own recording");
123124
assert.ok(Math.abs(voice.duration_s - 1) < 0.05, `duration ${voice.duration_s}`);
124125
assert.deepEqual([voice.words[0].start, voice.words[0].end], [0.5, 1]);
125126
const probe = spawnSync(

‎skills/media-use/references/audio.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ node <SKILL_DIR>/audio/scripts/audio.mjs --request ./audio_request.json --out ./
1212
- **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`.
1313
- **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/<id>.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.
1414
- **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.
15-
- **Output** `audio_meta.json` (id-keyed): `voices[].{path,duration_s,words[]}` (word timestamps for captions), `sfx[]`, `bgm`, `total_duration_s`.
15+
- **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`.
1616
- **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.
1717
- If BGM took the generate path (`bgm_pending: true`), run `audio/scripts/wait-bgm.mjs` before final render.
1818

‎skills/style-sampling/references/remix.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The person's message carries what it carries. Ask once, together, only what is s
2323

2424
- **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.
2525
- **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.
26-
- **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 <the script's language> --script "<first line>" --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.
26+
- **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 <the script's language> --script "<first line>" --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.
2727
- **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.
2828
- **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.
2929
- **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.

0 commit comments

Comments
 (0)