Buscar este blog
PROBAR CODIGO
Entradas
Entradas más recientes
ASISTENTE VIRTUAL
- Obtener enlace
- X
- Correo electrónico
- Otras aplicaciones
CURSOR
- Obtener enlace
- X
- Correo electrónico
- Otras aplicaciones
if (annyang){ var voices; var utter = new SpeechSynthesisUtterance(); utter.rate = 1; utter.pitch = 0.5; utter.lang = 'es-ES'; //Cargar las voces del sistema window.speechSynthesis.onvoiceschanged = function (){ voices = window.speechSynthesis.getVoices(); console.log(voices); }; //estos son los comandos var commands = { 'hola' : function() { //Setea la vos que queremos que nos hable. utter.text = 'HOLA SEÑOR'; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, 'Como estas': function () { utter.text = 'Estoy bien, Muchas gracias'; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, 'How are you': function () { utter.text = 'Estoy bien, Muchas gracias'; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, 'WHY YOU ONLY UNDERSTAND ENGLISH': function () { utter.text = 'Por que se me cantan los huevos, hijo de puta, motherfucker '; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, ' ': function () { utter.text = ''; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, 'Quien te creo': function () { utter.text = 'La persona que me creo es Alan'; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, // 'Quien te creo': function () { utter.text = 'La persona que me creo es Alan'; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, 'Horario': function () { utter.text = 'Tenemos, fisica, matematicas, quimica, bioologia, fundamentos de programacion'; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, '4': function () { utter.text = 'Tenemos, fisica, matematicas, quimica, bioologia, fundamentos de programacion'; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, // 'Cual es tu nombre': function () { utter.text = 'Mi nombre es maikol'; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, 'what is your name': function () { utter.text = 'Mi nombre es maikol'; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, 'Como te llamas': function () { utter.text = 'Mi nombre es maikol'; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, 'Dime tu nombre': function () { utter.text = 'Mi nombre es maikol'; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, 'Michael': function () { utter.text = 'Si, en que puedo ayudarle'; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, 'how to create you': function () { utter.text = 'La persona que me creo es Alan'; utter.voice = voices[6]; window.speechSynthesis.speak(utter); }, 'lista': function () { utter.text = 'Muy bien, señor'; utter.voice = voices[6]; window.speechSynthesis.speak(utter); annyang.addCallback('result', function (phrase){ //imprime la consola lo que dijo el usuario console.log("PRIMERO : ", phrases[0]); annyang.removeCallback('result'); utter.text = 'PRIMERO, ' + phrases[o]; window.speechSynthesis.speak(utter); }) }, 'hola soy nuevo': function () { utter.text = 'Hola, Cual es tu nombre'; utter.voice = voices[6]; window.speechSynthesis.speack(utter); annyang.addCallback('result', function (phrases){ //inprimer o muestra el nombre en la consola. console.log("Nombre : ", phrases[0]); //para el evento result. annyang.removeCallback('result'); //En esta parte nos dice hola mas el nombre. utter.text = 'hola, ' + phrases[0]; window.speechSynthesis.speak(utter); }) } }; annyang.addCallback('result', function(phrases) { console.log("CREO QUE TU DIJISTE: ", phrases[0]); console.log("PERO TAMBIEN CREO QUE DIJISTE ESTO: ", phrases); }); //Añadir los comandos a annyang annyang.addCommands(commands); //empezar a escuchar. annyang.start({autoRestart: false, continuos: true}); }