Read the statement by Michael Teeuw here.
Creating Custom Voice Commands for Hello-Lucy...?
-
@Doctor0ctoroc yep, you got it
-
@sdetweil said in Creating Custom Voice Commands for Hello-Lucy...?:
@Doctor0ctoroc yep, you got it
Yes! So now that I got a handle on that, I need to figure out how the .js and .json files utilize the local sphinx library.
@Mykle1 - can you lend a hand here? From the looks of it, I believe that the words.json and sentences.json files contain a reference list of all of the words and phrases used in the checkCommands.json file, and they’re referenced by the node_helper.js and Hello-Lucy.js files to implement the hide/show commands, yes? Something like that? A basic hierarchy should suffice to point me int he right direction.
-
@Doctor0ctoroc its builds the library from the sentences and words files…
then calls lmtool to generate the lm & dic files -
@sdetweil So are the .lm and .dic files generated in real time? Like, does whatever is added to the words.json and sentences.json files propagate into the .lm and .dic files or are you saying that both the words and sentences files are the basis for generating the .lm and .dic files through the sphinx tool?
-
@Doctor0ctoroc on module startup
-
@Doctor0ctoroc module sends a message to node_helper “START”
and then u can read the code in node_helper -
@sdetweil Ah, that’s fantastic. That would explain why when I changed “Hello Lucy” to “Hey Jarvis” in the Hello-Lucy.js and config file, it was added to the .dic and .lm file…I thought it was included in there from the get go (assuming the code was written to include an alternative, ‘familiar’ AI name that users might want) but all this time, it was my change of the code that put it in there - and it totally works when I say “Hey Jarvis” instead of “Hello Lucy”!
So there’s no need to even edit the .lm or .dic files directly then?
-
@Doctor0ctoroc no, they are generated each time the module starts
-
I think, for your purposes, you can simply do this, although I have not tested it:
-
In sentences.js file add your command(s). “CHEER ME UP” and “THANKS I FEEL BETTER” (MUST ALL BE CAPS)./
-
In checkCommands.json Sample -->
["SHOW","COMMAND","","","true","MMM-ModuleName",""], ["HIDE","COMMAND","","","false","MMM-ModuleName",""],
Changed to
["CHEER","ME","UP","","true","compliments",""], ["THANKS","I","FEEL","BETTER","false","compliments",""],
This should now make sense to you. I used the hide/show pairs mostly because I found the success rate higher when using shorter commands. I’ve “learned” how to talk to Lucy so my success rate is pretty darn good. I know others that have struggled for success.
Using what @sdetweil has told you and this simple format above, you should be on your way.
-
-
Ok, I just tested this and it works. You may find some commands work better than others. You’ll have to do some experimenting.