There is actually a way to do this using JavaScript and do it using the Web Speech API. This allows you to quickly perform speech recognition as well as speech synthesis.
The simplest example of speech synthesis:
var utterance = new SpeechSynthesisUtterance('Hello World'); window.speechSynthesis.speak(utterance);
The simplest example of voice recognition:
var recognition = new webkitSpeechRecognition(); recognition.onresult = function(event) { console.log(event); } recognition.start();
source share