Repository navigation
fix(media-use): keep the other voices when a TTS run re-voices some lines - #6816
DhanushMurugesanG wants to merge 5 commits into
Conversation
…ines With --only tts, audio.mjs replaced the whole voices list in audio_meta.json with the lines from that run, so re-voicing one line dropped every other voice. Voices now merge by line id under --only. A run without --only still replaces the list, as before. Also correct the places that said Kokoro has native word timestamps: `hyperframes tts` returns none, and the engine runs `hyperframes transcribe` over the WAV. Refs heygen-com#6708
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at 9a26f780c6a4a561dbe7c9be41c0c193c4c39bd0.
I checked the partial TTS merge, full replacement path and manifest recording. Re-voicing one line retains the other lines and records only fresh assets.
node --test audio-meta.test.mjs audio.test.mjs local-models.test.mjs: 40 passed. Provider subprocesses are stand-ins, no paid TTS calls. Fresh independent source and adversarial controls also passed.
Need: yes · Size: ok · Reuse: existing implementation seam · Simpler: already minimal · Structure: fine
Risk: medium - partial voice metadata persistence.
Verdict: APPROVE
Reasoning: I checked the partial TTS merge, full replacement path and manifest recording. Re-voicing one line retains the other lines and records only fresh assets.
Reasoning: I checked the partial TTS merge, full replacement path and manifest recording. Re-voicing one line retains the other lines and records only fresh assets.
…-partial-tts # Conflicts: # skills-manifest.json
…-partial-tts # Conflicts: # skills-manifest.json
|
Thanks for the review, @jrusso1020! |
…-partial-tts # Conflicts: # skills-manifest.json
|
@jrusso1020 main changed |
…-partial-tts # Conflicts: # skills-manifest.json
…view to heygen-com#7265 Adopt heygen-com#7284 (Studio Storyboard tab and `doc: "storyboard"` Desktop handoff, adapted to the fork's desktopApp without heygen-com#6897) and heygen-com#7324 (drawElement gate: webgl_unavailable / beginframe_no_self_verify). PR axis heygen-com#7260-heygen-com#7265 carries earlier verdicts; re-pin heygen-com#6695 and heygen-com#6816, resolve heygen-com#7150 as superseded by heygen-com#5746. Watermarks: commit 18fc75d, PR heygen-com#7265, issue heygen-com#7223, monitored 99. Co-authored-by: WaterrrForever <miao.yang@heygen.com> Co-authored-by: Vance Ingalls <vance@heygen.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
With
--only, the media-use audio engine (skills/media-use/audio/scripts/audio.mjs) now merges voices by id. A TTS run whose request lists only some lines re-voices those lines and keeps every other voice inaudio_meta.json. Before this change, it replaced the wholevoiceslist with the lines from that run. A run without--onlystill replaces the list, as before.It also corrects the places that said Kokoro has native word timestamps. HyperFrames' Kokoro path (
hyperframes tts) returns none; the engine gets the word timings by runninghyperframes transcribeover the WAV.Why
Steps to reproduce on
main:--only ttsand a request that lists linesa,bandc.audio_meta.jsonhas three voices.b, and run again with a request that lists onlyb.audio_meta.jsonnow has one voice,b. Voicesaandcare gone, though their WAV files are still on disk, andtotal_duration_scounts onlyb.--onlyis documented as merging into an existing--out, both in the engine header and inskills/media-use/references/audio.md. BGM and SFX already merge. The voice list did not.Related work
Refs #6708. This is a small, separate fix found while reading the code for that issue. It does not implement linked narration. I searched open and closed issues and PRs for this bug and found no existing report.
Open PRs #5819 and #5702 also edit
audio.mjs, insidesynthLine, a few lines above this change. The logic does not overlap. Those two and #5568 also change themedia-usehash inskills-manifest.json, so whichever lands later needs to regenerate that file.How
mergeVoices(previous, fresh, { requested, exists })inskills/media-use/audio/scripts/lib/audio-meta.mjs:audio.mjscallsmergeVoiceswhere it calledresults.filter(Boolean), but only when--onlyis passed. A full run without--onlystill replaces the list, so removing a line from the request still drops its voice.total_duration_sis computed from the resulting list, and the header comment says when voices merge.writtenAssetsgets this run's voices, not the merged list. Otherwise the kept voices would be recorded again under this run's provider, with the file name as their description.packages/cli/src/media-use/lib/local-models.mjs,wordTimestampsis now"transcribe"and thenotestext is corrected. The field names where a model's timings come from, as"whisperx"does for fish-speech. The header comment intts-local-provider.mjsand one assertion message inlocal-models.test.mjsare corrected too. Nothing reads kokoro'swordTimestampsvalue at run time.Test plan
skills/media-use/audio/scripts/lib/audio-meta.test.mjs:mergeVoicescases:skills/media-use/audio/scripts/audio.test.mjs: an end-to-end run of the engine, with stubnpx(ttsandtranscribe) andffprobeonPATH. It voicesa,bandc, then re-voices onlyb, and checks that:aandcstay, andbis replaced in placetotal_duration_sis the sum of all threeb--onlythat lists onlyaandcdropsb, as beforeOn
mainthis test fails with onlybleft. It is skipped on Windows, astts.cleanup.test.mjsis.packages/cli/src/media-use/lib/local-models.test.mjs: assertion message updated.skills/media-use/references/audio.mdsaying how voices merge under--only tts.node scripts/check-comment-citations.mjsandnode scripts/comment-ratchet.mjspass on this diff.Commands run: