TalAter / annyang

:speech_balloon: Speech recognition for your site
https://www.talater.com/annyang/
MIT License
6.57k stars 1.05k forks source link

Change interval at which as sentence is detected #460

Open sojs-coder opened 3 months ago

sojs-coder commented 3 months ago

Expected Behavior

I need an option in the start function that allows me to change the interval at which speech is detected. I want to be able to set something like:

a.start({
   interval: 250
});

and have it register a new phrase every 250 ms. Eg: if a person is talking continuously, he doesnt need to stop talking for the command to be fired.

Current Behavior

As of right now, as I talk, nothing happens. Once I stop talking, the event is fired on whatever callbacks I have configured. Doing testing, I find that the callback is fired only after 1 second of not talking. This should be configurable

Possible Solution

Went through the code, but I could not find where trigger was called and so I could not submit a PR

Steps to Reproduce (for bugs)

if (annyang) {
    var commands = {
        '*catchAll': catchAll
    };

    annyang.addCommands(commands);

    annyang.start();
}

function catchAll(caught){
    console.log(caught)
}

Context

I would prefer if I were able to read a continuous stream of text as it was spoken - not after