diff --git a/modules/turnero/views/display_global.php b/modules/turnero/views/display_global.php index 82840aa..9d0834a 100644 --- a/modules/turnero/views/display_global.php +++ b/modules/turnero/views/display_global.php @@ -588,15 +588,17 @@ function anunciarTurno(codigo, destino, paciente) { if (voz) utt.voice = voz; utt.rate = 0.95; utt.pitch = 1.05; utt.volume = 1; - // Con el sintetizador libre se habla de inmediato. Solo cuando hay algo en - // curso hace falta cancelar y esperar un instante: Chrome ignora un speak() - // encadenado a un cancel() en el mismo ciclo. + // Se espera a que el pito termine (dura 0,65 s) antes de hablar. Hablando + // encima, el tono tapaba "Turno X" y desde lejos parecía que el anuncio + // empezaba ya empezado. + const BEEP_MS = 700; + + // Solo cuando hay algo en curso hace falta cancelar: Chrome ignora un + // speak() encadenado a un cancel() en el mismo ciclo. if (window.speechSynthesis.speaking || window.speechSynthesis.pending) { window.speechSynthesis.cancel(); - setTimeout(() => window.speechSynthesis.speak(utt), 80); - } else { - window.speechSynthesis.speak(utt); } + setTimeout(() => window.speechSynthesis.speak(utt), BEEP_MS); return utt; } diff --git a/modules/turnero/views/voces.php b/modules/turnero/views/voces.php new file mode 100644 index 0000000..e88a345 --- /dev/null +++ b/modules/turnero/views/voces.php @@ -0,0 +1,141 @@ + + + +
+ + +