From f02f4f3e6000a5f26caf9ccd51410aece85b4e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Henrique?= Date: Wed, 9 Sep 2026 10:28:07 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20adicionada=20op=C3=A7=C3=A3o=20para=20c?= =?UTF-8?q?alcular=20m=C3=A9tricas=20de=20voz=20automaticamen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - adicionada opção para calcular métricas de voz automaticamente após a transcrição - reorganizada a etapa opcional para revisar falantes e métricas processados automaticamente Resumo: - 2 arquivos alterados - 0 novos - 2 modificados - 0 removidos 2 files changed, 24 insertions(+), 8 deletions(-) Arquivos: - code/cep-plugin/index.html - code/cep-plugin/main.js --- code/cep-plugin/index.html | 13 +++++++++---- code/cep-plugin/main.js | 19 +++++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/code/cep-plugin/index.html b/code/cep-plugin/index.html index e015170..e212506 100755 --- a/code/cep-plugin/index.html +++ b/code/cep-plugin/index.html @@ -138,6 +138,11 @@ Detectar quem fala logo após transcrever + +
Métricas de voz Pitch, energia, velocidade de fala e pausas de cada trecho.
- +
diff --git a/code/cep-plugin/main.js b/code/cep-plugin/main.js index d449ea5..e9618aa 100755 --- a/code/cep-plugin/main.js +++ b/code/cep-plugin/main.js @@ -1786,15 +1786,25 @@ function silenceTranscribe() { } taskEnd(true, "Transcrição pronta: " + resumo); unlockAfterTranscript(); - if (document.getElementById("silenceDiarize").checked) { - silenceDiarizeSpeakers(); - } + silenceRunAutomaticEnrichments(); }, hfSpawnOptions() ); } -function silenceDiarizeSpeakers() { +function silenceRunAutomaticEnrichments() { + var shouldDiarize = document.getElementById("silenceDiarize").checked && !!loadHfToken(); + var shouldMeasureVoice = document.getElementById("silenceVoiceFeaturesAuto").checked; + if (shouldDiarize) { + silenceDiarizeSpeakers(function () { + if (shouldMeasureVoice) silenceComputeVoiceFeatures(); + }); + } else if (shouldMeasureVoice) { + silenceComputeVoiceFeatures(); + } +} + +function silenceDiarizeSpeakers(onFinished) { if (!silenceState.transcriptPath) return; if (!silenceState.mediaPath) { silenceLog("Detecte o clipe/sequência primeiro (passo 1) para saber qual vídeo diarizar.", "err"); @@ -1843,6 +1853,7 @@ function silenceDiarizeSpeakers() { setStep(3, "done", "Enriquecido"); taskEnd(true, msg); syncTranscriptToCache(); + if (typeof onFinished === "function") onFinished(); }, hfSpawnOptions() );