0

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

omega
  • 40,311
  • 81
  • 251
  • 474

2 Answers2

0

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;
    }
}
0

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;
            }
 }