Reputation: 191
I'm trying to use the SpeechRecognition API to create a speech-to-text interface. Here's my configuration:
const recognition = new SpeechRecognition();
recognition.continuous = true;
recognition.lang = 'en-US';
recognition.onresult = (event) => {...}
recognition.start();
It works great on desktop, but it seems that most mobile devices don't support continuous listening, and when trying to record from them the microphone turns on and off constantly.
I tried to work around it by immediately starting it again after the onend
event:
recognition.onend= (event) => {recognition.start();}
But the problem is that onend
fires after the microphone has been turned off, which makes constant beeping sounds on some devices, and problems fully recognizing the speech.
Is there any way to intervene before the microphone is turned off?
Upvotes: 7
Views: 800