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;
}
}
}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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;
}
}
}