All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m6s
1.7 KiB
1.7 KiB
TTS Language Contract Design
Goal
Upgrade subtitle generation so the model always produces English subtitle text for display, plus a separate TTS translation and language code for dubbing.
Scope
- Keep current upload and editor UI unchanged for this step.
- Add backend contract support for
ttsTextandttsLanguage. - Let dubbing prefer
ttsTextovertranslatedText. - Keep existing calls backward compatible by defaulting
ttsLanguageto the current target language when none is provided.
Design
Prompt contract
translatedTextbecomes the on-screen subtitle text and must always be English.ttsTextbecomes the spoken dubbing text in the requested TTS language.ttsLanguagemust be returned on every subtitle item and must exactly match the requested TTS language code.- The system and user prompts should clearly separate subtitle language from TTS language.
Data model
- Extend
Subtitlewith optionalttsTextandttsLanguage. - Extend raw model subtitle parsing to accept these fields.
- Extend pipeline result metadata to track
ttsLanguage.
Runtime behavior
- Subtitle generation should accept an optional
ttsLanguage. - If not provided, use
targetLanguageto avoid breaking existing flows. - Voice catalog selection should use the TTS language, not the subtitle language.
- TTS generation should read
subtitle.ttsTextfirst, then fall back totranslatedText, thentext.
Testing
- Add prompt tests asserting the new system and user prompt text references English subtitles plus TTS language.
- Add parsing tests asserting
ttsTextandttsLanguageare normalized into subtitles. - Add service tests asserting
ttsLanguageis forwarded through the subtitle pipeline request body.