Витязи Team
Витязи Team

Reputation: 369

Speech Recognition API. The speechend event and speechstart are not working correctly. Especially speechend

The speechend event and speechstart are not working correctly. Especially speechend.

For example, I start talking and the speechstart event is triggered. But when I stopped talking, the speechend event doesn't fire. It is triggered only after a few seconds. And then immediately the end event is triggered.

 let speechRecognition = new window.webkitSpeechRecognition();

 speechRecognition.continuous = true;
                speechRecognition.interimResults = true;
                speechRecognition.lang = "ru-RU";
speechRecognition.onspeechstart = () => {
  console.log("Speech start") // correctly working
  }
  speechRecognition.onspeechend = () => {
  console.log("Speech end") // this event will trigger in some few seconds.. 10 or 15
  }
  speechRecognition.start()

Upvotes: 1

Views: 882

Answers (1)

Mei Lin
Mei Lin

Reputation: 11

Maybe if you try this :

speechRecognition.continuous = false;

Upvotes: 1

Related Questions