Read the statement by Michael Teeuw here.
[npm library] @bugsounet/snowboy
-
@bugsounet/snowboy
I created this library if you want use snowboy in your module.
This library is very simplified and ready for use in yournode_helper.jsThis library is used in MMM-GoogleAssistant, MMM-Snowboy, MMM-AssistantMk2
Dependencies
For listening keyword, you have to use a mic, so
snowboyneed some dependencies to use itsudo apt install libmagic-dev libatlas-base-dev sox libsox-fmt-all build-essentialInstallation
npm install @bugsounet/snowboyIn the ending of installation, if you use
electronyou can do electron rebuild step.Do you want to execute electron rebuild ? [Y/n] Your choice:Sample with new Snowboy contructor
/** sample code for using snowboy library **/ /** @bugsounet **/ const Snowboy = require("@bugsounet/snowboy").Snowboy var config = { debug: true, snowboy: { audioGain: 2.0, Frontend: true, Model: "jarvis", Sensitivity: null }, micConfig: { recorder: "arecord", device: "plughw:1", }, } this.snowboy = new Snowboy(config.snowboy, config.micConfig, (detected) => { detect(detected) }, config.debug ) this.snowboy.init() this.snowboy.start() function detect(detected) { console.log("Make your script if " + detected + " is detected") }constructor of Snowboy
Snowboy(snowboyConfig, micConfig, callback, debug)
SnowboyConfig
-
AudioGain- set the gain of mic. Usually you don’t need to set or adjust this value. -
Frontend- set pre-processing of hotword detection. When you use only snowboy and smart_mirror, false is better. But with other models, true is better to recognize. -
Model- set the name of your detector. Available: “smart_mirror”, “jarvis”, “computer”, “snowboy”, “subex”, “neo_ya”, “hey_extreme”, “view_glass” -
Sensitivity- Override default sensitivity value for applied model defined inModel.-
Value could be within a range from
0.0to1.0. -
Default sensitivity values for preconfigured models are:
- smart_mirror:
0.5 - jarvis:
0.7 - computer:
0.6 - snowboy:
0.5 - subex:
0.6 - neo_ya:
0.7 - hey_extreme:
0.6 - view_glass:
0.7 - alexa:
0.6
- smart_mirror:
-
nullwill set default sensitivity.
-
micConfig
-
recorder- record program,rec,arecord,sox,parecis available.- On RaspberryPi or some linux machines,
arecordis better. - On OSX,
recis better. - If you prefer to use
pulse audio,parecwould be available also.
- On RaspberryPi or some linux machines,
-
device- recording device (microphone) name of your environment. (e.g. “plughw:1”)- Find proper device name by yourself. (arecord -l will be help on Raspberry Pi or linux platform)
callback
if snowboy detect a keyword, it return it with his name
debug
if you want debuging information, just set to
trueFunctions
init(): initialize the constructorstart(): start listening and waiting for your keywordstop(): force stop listening
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login