Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Speech Recognition - Run continuously

I'm trying to create an HTML5-powered voice-controlled editor using the Speech Recognition API. Currently, the problem is when you start recording, it only lasts for a certain amount of time (basically until the user stops talking).

I can set continuous and interimResults to true, but that doesn't keep it recording forever. It still ends.

I can also tell it to start again during the end event, but then it asks for permission every time, which is highly disruptive.

Is there a way to allow it to go continuously while only having to ask a user once?

like image 730
samanime Avatar asked May 01 '15 22:05

samanime


People also ask

What is a continuous speech recognition?

Continuous speech recognition systems allow the user to talk to the system without stops and pauses. Continuous speech recognition systems can recognize more utterances than a command-and-control system. The guidelines for continuous speech recognition differ somewhat from those for command-and-control.

What are the limitations of speech recognition?

There are limitations to speech recognition software. It does not always work across all operating systems. Noisy environments, accents and multiple speakers may degrade results. Also, regular voice recognition software can lack integration with other key services.

What is an automatic speech recognition system?

Automated speech recognition (ASR) is a technology that allows users of information systems to speak entries rather than punching numbers on a keypad. ASR is used primarily to provide information and to forward telephone calls.


1 Answers

No matter the settings you'll choose, Google Chrome stops the speech recognition engine after a while... there's no way around it.

The only reliable solution I've found for continuous speech recognition, is to start it again by binding to the onend() event, as you've suggested.

If you try a similar technique, be aware of the following:

  1. If you are not on HTTPS, the user will be prompted to give permission over and over again on each restart. For this, and many other reasons, don't compromise on HTTP when using Speech Recognition.

  2. Make sure you are not restarting the speech recognition immediately onend() without some safeguards to make sure you aren't putting the browser into an endless loop (e.g. two open tabs with onend(function() {restart()}) can crash the browser, as I've detailed in this bug report: https://code.google.com/p/chromium/issues/detail?id=296690) See https://github.com/TalAter/annyang/blob/1ee294e2b6cb9953adb9dcccf4d3fcc7eca24c2c/src/annyang.js#L214 for how I handle this.

  3. Don't autorestart if the reason for it ending is something like service-not-allowed or not-allowed See https://github.com/TalAter/annyang/blob/1ee294e2b6cb9953adb9dcccf4d3fcc7eca24c2c/src/annyang.js#L196

You can see how I handled this in my code - https://github.com/TalAter/annyang/blob/master/src/annyang.js

like image 160
Tal Ater Avatar answered Oct 16 '22 09:10

Tal Ater