0

I have just implemented speech recognition in React.js application using JS vanilla code in the function. In desktop Chrom I tested it successfully, but in Android chrome it didn't work. Any ideas?

setSpeechRecognition(true);
 var recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
                recognition.lang = 'en-US';
                recognition.interimResults = false;
                recognition.maxAlternatives = 5;
                recognition.start();
                recognition.onresult = function (event: any) {
                    clickHandler(event.results[0][0].transcript);
                    console.log('You said: ', event.results[0][0].transcript);
                };
Tuvia Khusid
  • 792
  • 5
  • 15
  • 31
  • Do you have any errors? May the user allow the speech recognition? For being sure, put the `Start()` after adding the onresult handler. '' . Any details are much appreciated. Also checkout this: https://stackoverflow.com/questions/42134899/webkitspeechrecognition-on-android-chrome – Silvan Bregy May 01 '22 at 12:34
  • No, I don't see any errors. Just debugged it – Tuvia Khusid May 02 '22 at 08:44

0 Answers0