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';