Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created April 24, 2019 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/40667079822f81572c335d33d1393c4b to your computer and use it in GitHub Desktop.
Save parzibyte/40667079822f81572c335d33d1393c4b to your computer and use it in GitHub Desktop.
let textoAEscuchar = $mensaje.value;
if (!textoAEscuchar) return alert("Escribe el texto");
let mensaje = new SpeechSynthesisUtterance();
mensaje.voice = vocesDisponibles[$voces.value];
mensaje.volume = 1;
mensaje.rate = 1;
mensaje.text = textoAEscuchar;
mensaje.pitch = 1;
// ¡Parla!
speechSynthesis.speak(mensaje);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment