Comments (3)
Hey @fraschizzato i'm working on it but i see that the pause function (use .fatality
to stop) may not work properly according to how you use it.
Please, download the dev-nodownload version of artyom and test what you want to achieve using the new methods. I don't want to publish the 0.9.7 version yet, so if you want to test it quick download the dev-nodownload please here.
New methods :
- artyom.obey : enable the command recognition if disabled.
- artyom.dontObey : disable the command recognition (not speechRecognition) dinamically.
- artyom.initialize (new property) :
obeyKeyword
property. If the command recognition is disabled with the dontObey method, it will be automatically enabled if you say theobeyKeyword
while the command recognition is disabled (the suggested wakeUp command).
This will be published in the next version.
// add the hello commands
artyom.addCommands({
indexes: ["Hello"],
action: function(i){
console.log("Hey, i just said hello ... or maybe was the computer, snap!");
}
});
// Start artyom how you always do ..
// But if you want the "wake up command"
// if artyom is not obeying, use the obeyKeyword property
artyom.initialize({
lang:"en-GB",
continuous:true,
debug:true,
listen:true,
// if artyom is not obeying (paused) and the users says the obeyKeyword
// it will continue with the command recognition (obey again)
// if you say "start again" and artyom is not obeying, it will obey again.
obeyKeyword: "start again"
});
// Talk something that may match with hello command
// Change the text with something of yours
artyom.say("Hello this message would normally match with a command.",{
onStart:function(){
// Don't obey any command
artyom.dontObey();
},
onEnd: function(){
setTimeout(function(){
// Allow to process commands again
artyom.obey();
},2000);// wait 2 seconds
}
});
However there are 2 behaviours that you need to know, if you're talking about "pause" that means
the recognition needs to be "active", therefore it will keep recognizing text till its end (unless you cancel or restart it).
That will cause that the onResult event of the speechRecognition will keep the text previously recognized
(even if artyomRecognition is paused) and it will processed again, triggering pitifully your command although it is paused.
Although what you want is difficult to achieve because the webkitSpeechRecognition cannot be paused (only methods : abort, start and stop), the processing can be
temporary paused while you use artyom.say
using the onStart and onEnd callbacks.
If someone speaks after the onEnd callback, then it is most likely to keep saving the previous spoken text and it will fail.
Note : this works only in "normal" mode of artyom, with "quick" is not possible even without the timeout.
A simple solution would be to stop artyom when artyom says something and initialize it again (using timeout) because there's no other solution when you work in noisy environments (only with headphones would work :( ).
from artyom.js.
Perfect, thanks
from artyom.js.
Function is now available since artyom 0.9.7 and the remote mode.
from artyom.js.
Related Issues (20)
- newPrompt returns before receiving a spoken response
- React native HOT 1
- Raspberry artyom HOT 1
- Capturing values with Regex expressions
- .say() and continuos recognition creates a loop
- Voice command
- Very handy tool, looking for progress
- Artyom does not recognize the command HOT 1
- Contentious restarting for no reason.
- Additional languages
- Is there a way for it to only recognise the defined commands?
- Speech Recognition Doesn't work on Safari standalone app on IOS<17
- Regex with wildcard
- Webview with artyom
- Basic Usage with TS HOT 1
- Remove command Callbacks (TEXT_RECOGNIZED).
- Allow adding custom JSGF
- Speech adaptation
- artyom.say doesn't speak after some time HOT 2
- problem installing node.js HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from artyom.js.