'Chrome web speech recognition api results returning repeated words?
I am trying the web speech recognition api for speech to text. There is an online demo here https://www.google.com/intl/en/chrome/demos/speech.html
but if I try that or even implement it myself, there is a problem of it repeating words. So if I say test it comes back as testtest. Ive seen at least two other people comment on the same issue on other forums. Is this a known issue/bug?
Thanks
Solution 1:[1]
in php split the string to words and pass each word to this function and get back unique word.
function remove_duplicate_char($str)
{
$l = strlen($str);
//echo "<br>==".$l;
//first characters
$firstchar = $str[0].$str[1].$str[2];
//echo "<br>===".$firstchar;
//repeatstart
$repeat = strpos($str,$firstchar,2);
//1echo "<br>repeat =".$repeat;
if($repeat >0)
{
$mainword = substr($str,0,$repeat);
return $mainword;
}
else
{
return $str;
}
}
Solution 2:[2]
I have used confidence as a way around this issue, i know it is too late but hope it helps.
for (let i = event.resultIndex; i < event.results.length; i++) {
if (!(event.results[i][0].confidence > 0)) continue;
if (event.results[i].isFinal && event.results[i][0].confidence >= 0.7) {
finalTranscript = event.results[i][0].transcript;
} else {
this.feedback += event.results[i][0].transcript;
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | shiva prasad reddy puchala |
