-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.js
38 lines (34 loc) · 838 Bytes
/
popup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//instance Artom object
let artyom = new Artyom();
//check if APIs supported
if(!artyom.speechSupported()) alert('speechSupported not supported')
if(!artyom.recognizingSupported()) alert('recognizingSupported not supported')
//stop any recognition
artyom.fatality();
//initialize artyom
artyom.initialize({
lang:"en-GB",
continuous:true,
listen:true,
debug:true,
obeyKeyword: "listen to me",
speed:1
}).then(function(){
artyom.say("ready");
});
//commands
artyom.addCommands([
{
description:"Say hi to me",
indexes:["hello","shut down yourself"],
action:function(i){
if(i == 0){
artyom.say('hi')
}
if(i == 1){
artyom.dontObey();
artyom.say('you will regret')
}
}
}
]);