From 4010e6e6c6183ef05721d251507f0e72799eb1da Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Thu, 30 Jul 2026 20:12:18 -0500 Subject: [PATCH] =?UTF-8?q?fix(LIA):=20voz=20femenina=20en=20espa=C3=B1ol?= =?UTF-8?q?=20y=20quitar=20emoji=20de=20saludo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- modules/turnero/views/dashboard.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/turnero/views/dashboard.php b/modules/turnero/views/dashboard.php index 0c70025..5a60f1c 100644 --- a/modules/turnero/views/dashboard.php +++ b/modules/turnero/views/dashboard.php @@ -720,11 +720,20 @@ function _stripMd(text) { return text.replace(/\*\*(.+?)\*\*/g,'$1').replace(/^\* /gm,'').replace(/\n/g,' '); } +function _vozFemenina() { + const vs = window.speechSynthesis.getVoices(); + return vs.find(v => v.lang.startsWith('es') && /female|mujer|paulina|sabina|monica|helena|lucia|penelope|conchita|paloma|maria|carmen/i.test(v.name)) + || vs.find(v => v.lang.startsWith('es') && !v.name.toLowerCase().includes('male')) + || vs.find(v => v.lang.startsWith('es')) + || null; +} + function hablarIA(text) { if (!_ttsOn || !window.speechSynthesis) return; window.speechSynthesis.cancel(); const utt = new SpeechSynthesisUtterance(_stripMd(text)); utt.lang = 'es-CO'; utt.rate = 1.05; + const v = _vozFemenina(); if (v) utt.voice = v; window.speechSynthesis.speak(utt); } @@ -778,7 +787,7 @@ function _liaGreet() { const llave = 'lia_greeted_' + hoy; if (localStorage.getItem(llave)) return; localStorage.setItem(llave, '1'); - const msg = 'Hola, soy LIA 👋 ¿En qué te puedo asistir hoy?'; + const msg = 'Hola, soy LIA. ¿En qué te puedo asistir hoy?'; const msgs = document.getElementById('aiMessages'); const el = document.createElement('div'); el.className = 'ai-msg bot';