Integração: falantes + dublagem + vídeo final

- editor_api: importa dub e speakers juntos.
- voice_chunks (falantes) vira a migração v15, depois da v14 do vídeo final (antes era criada fora das migrações).
- dub.voice_for: qualquer voz que não é o streamer (other1, other2…) usa a segunda voz da dublagem.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Mateuus
2026-11-18 03:59:44 -03:00
co-authored by Claude Opus 5.5
24 changed files with 1671 additions and 129 deletions
+5 -3
View File
@@ -36,7 +36,7 @@ from .editor import to_output
log = logging.getLogger("cenaforge_clipper.dub")
FALLBACK_VOICE = "pt-br-faber" # Piper, offline: quando a voz escolhida (Edge, online) falha
SPEAKER_OTHER = "other" # `lines[].speaker` (outro agente): "streamer" | "other"; ausente = streamer
SPEAKER_OTHER = "other" # `lines[].speaker` (FALANTES.md): "streamer" | "other1", "other2"…; ausente = streamer
# Esclarecimento do dono (18/11/2026): NÃO é dublagem de filme — é para a equipe entender o contexto. Nada de
# sincronia labial: cada fala começa perto do início da original, em velocidade natural (inteligível primeiro), e pode
# escorrer depois da fala original. Duas nunca tocam juntas e o atraso não acumula (limite por frase, `MAX_LATE_S`).
@@ -79,8 +79,10 @@ def options(cfg: dict) -> dict:
def voice_for(line: dict, opts: dict) -> str:
"""Voz da frase: `speaker == "other"` usa a segunda voz; sem o campo (ou qualquer outro valor), a padrão."""
return opts["voiceOther"] if line.get("speaker") == SPEAKER_OTHER else opts["voice"]
"""Voz da frase: qualquer voz que não é o streamer (`other`, `other1`, `other2`…) usa a segunda voz; sem o
campo, a padrão."""
speaker = line.get("speaker")
return opts["voiceOther"] if isinstance(speaker, str) and speaker.startswith(SPEAKER_OTHER) else opts["voice"]
# ---------------------------------------------------------------- plano (contas puras, sem áudio)