onna / ngx-speech

Voice recognition for Angular 5
MIT License
16 stars 7 forks source link

Adjust continous recognition and time before automatically ending #5

Open coltaemanuela opened 6 years ago

coltaemanuela commented 6 years ago

Hello! From where it is possible to adjust the time spare before the recognition will automatically stop? At the stop, if I make a break of a few milliseconds, the recognition will end. How can set it to a different value or set the recognition not to be continuous? Can you provide some documentation on this topic? Thank you!

ebrehault commented 6 years ago

Hi @coltaemanuela,

ngx-speech is a basic Angular wrapper for the default web browser SpeechRecognition object, so it just behaves like SpeechRecognition does. Here is the full documentation: https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition

I do not really know how we can adjust the recognition minimal time before stopping, here is what I've found though: https://stackoverflow.com/questions/42740112/detect-the-time-when-the-user-talk-speechrecognition-api

Maybe it can help.

coltaemanuela commented 6 years ago

Thank you! I came across this before, but not really managed to adjust that. I will keep trying and research about it. Thank you! :)

ebrehault commented 6 years ago

If you find a proper solution, please consider making a pull request here.

Meanwhile, a possibly valid workaround could be to split all the commands in any possible separated words or separated group of words, like:

"Go back to home"

would be matched by any of those messages:

"Go back to", "home"
"Go", "back", "to", "home"
"Go back", "to", "home"
"Go", "back to", "home"
"Go back", " to home"
"Go", "back to home"
etc.