DEV Community

Discussion on: Voice controlled ToDo List: JavaScript Speech Recognition

Collapse
 
ddsigampa profile image
David sigampa

Hello, I am building an mvc application to translate speech to text, my project continues trying to do different actions (build a video playlist) for each identified word.
Doing some tests with interimResults=true the console shows "well" "Wellco" "wellcome", which executes 3 actions to the server. Is there any way to identify when the speech engine already identified the complete word?

call function when identifying the whole word

Here is:
recognition.onresult = function (event) {
var final = "";
var interim = "";
for (var i = 0; i < event.results.length; ++i) {
if (event.results[i].isFinal) {
final += event.results[i][0].transcript;
textoFinal.innerHTML = final;
} else {
interim += event.results[i][0].transcript;
texto.innerHTML = interim;
}
}
}