{ "info": { "author": "KITT.AI", "author_email": "snowboy@kitt.ai", "bugtrack_url": null, "classifiers": [], "description": "# Snowboy Hotword Detection\n\nby [KITT.AI](http://kitt.ai).\n\n[Home Page](https://snowboy.kitt.ai)\n\n[Full Documentation](http://docs.kitt.ai/snowboy) and [FAQ](http://docs.kitt.ai/snowboy#faq)\n\n[Discussion Group](https://groups.google.com/a/kitt.ai/forum/#!forum/snowboy-discussion) (or send email to snowboy-discussion@kitt.ai)\n\n(The discussion group is new since September 2016 as we are getting many messages every day. Please send general questions there. For bugs, use Github issues.)\n\nVersion: 1.2.0 (3/25/2017)\n\n## Alexa support\n\nSnowboy now brings hands-free experience to the [Alexa AVS sample app](https://github.com/alexa/alexa-avs-sample-app) on Raspberry Pi! See more info below regarding the performance and how you can use other hotword models.\n\n**Performance**\n\nThe performance of hotword detection usually depends on the actually environment, e.g., is it used with a quality microphone, is it used on the street, in a kitchen, or is there any background noise, etc. So we feel it is best for the users to evaluate it in their real environment. For the evaluation purpose, we have prepared an Android app which can be installed and run out of box: [SnowboyAlexaDemo.apk](https://github.com/Kitt-AI/snowboy/raw/master/resources/alexa/SnowboyAlexaDemo.apk) (please uninstall any previous one first if you installed this app before). \n\n**Personal model**\n* Create your personal hotword model through our [website](https://snowboy.kitt.ai) or [hotword API](https://snowboy.kitt.ai/api/v1/train/)\n* Replace the hotword model in [Alexa AVS sample app](https://github.com/alexa/alexa-avs-sample-app) (after installation) with your personal model\n\n```\n# Please replace YOUR_PERSONAL_MODEL.pmdl with the personal model you just\n# created, and $ALEXA_AVS_SAMPLE_APP_PATH with the actual path where you\n# cloned the Alexa AVS sample app repository.\ncp YOUR_PERSONAL_MODEL.pmdl $ALEXA_AVS_SAMPLE_APP_PATH/samples/wakeWordAgent/ext/resources/alexa.umdl\n```\n\n* Set `APPLY_FRONTEND` to `false` and update `SENSITIVITY` in the [Alexa AVS sample app code](https://github.com/alexa/alexa-avs-sample-app/blob/master/samples/wakeWordAgent/src/KittAiSnowboyWakeWordEngine.cpp) and re-compile\n\n```\n# Please replace $ALEXA_AVS_SAMPLE_APP_PATH with the actual path where you\n# cloned the Alexa AVS sample app repository.\ncd $ALEXA_AVS_SAMPLE_APP_PATH/samples/wakeWordAgent/src/\n\n# Modify KittAiSnowboyWakeWordEngine.cpp and update SENSITIVITY at line 28.\n# Modify KittAiSnowboyWakeWordEngine.cpp and set APPLY_FRONTEND to false at\n# line 30.\nmake\n```\n\n* Run the wake word agent with engine set to `kitt_ai`!\n\n**Universal model**\n* Replace the hotword model in [Alexa AVS sample app](https://github.com/alexa/alexa-avs-sample-app) (after installation) with your universal model\n\n```\n# Please replace YOUR_UNIVERSAL_MODEL.umdl with the personal model you just\n# created, and $ALEXA_AVS_SAMPLE_APP_PATH with the actual path where you\n# cloned the Alexa AVS sample app repository.\ncp YOUR_UNIVERSAL_MODEL.umdl $ALEXA_AVS_SAMPLE_APP_PATH/samples/wakeWordAgent/ext/resources/alexa.umdl\n```\n\n* Update `SENSITIVITY` in the [Alexa AVS sample app code](https://github.com/alexa/alexa-avs-sample-app/blob/master/samples/wakeWordAgent/src/KittAiSnowboyWakeWordEngine.cpp) and re-compile\n\n```\n# Please replace $ALEXA_AVS_SAMPLE_APP_PATH with the actual path where you\n# cloned the Alexa AVS sample app repository.\ncd $ALEXA_AVS_SAMPLE_APP_PATH/samples/wakeWordAgent/src/\n\n# Modify KittAiSnowboyWakeWordEngine.cpp and update SENSITIVITY at line 28.\nmake\n```\n\n* Run the wake word agent with engine set to `kitt_ai`!\n\n\n## Hotword as a Service\n\nSnowboy now offers **Hotword as a Service** through the ``https://snowboy.kitt.ai/api/v1/train/``\nendpoint. Check out the [Full Documentation](http://docs.kitt.ai/snowboy) and example [Python/Bash script](examples/REST_API) (other language contributions are very welcome).\n\nAs a quick start, ``POST`` to https://snowboy.kitt.ai/api/v1/train:\n\n\t{\n\t \"name\": \"a word\",\n\t \"language\": \"en\",\n\t \"age_group\": \"10_19\",\n\t \"gender\": \"F\",\n\t \"microphone\": \"mic type\",\n\t \"token\": \"\",\n\t \"voice_samples\": [\n\t {wave: \"\"},\n\t {wave: \"\"},\n\t {wave: \"\"}\n\t ]\n\t}\n\nthen you'll get a trained personal model in return!\n\n## Introduction\n\nSnowboy is a customizable hotword detection engine for you to create your own\nhotword like \"OK Google\" or \"Alexa\". It is powered by deep neural networks and\nhas the following properties:\n\n* **highly customizable**: you can freely define your own magic phrase here \u2013\nlet it be \u201copen sesame\u201d, \u201cgarage door open\u201d, or \u201chello dreamhouse\u201d, you name it.\n\n* **always listening** but protects your privacy: Snowboy does not use Internet\nand does *not* stream your voice to the cloud.\n\n* light-weight and **embedded**: it even runs on a Raspberry Pi and consumes\nless than 10% CPU on the weakest Pi (single-core 700MHz ARMv6).\n\n* Apache licensed!\n\nCurrently Snowboy supports (look into the [lib](lib) folder):\n\n* all versions of Raspberry Pi (with Raspbian based on Debian Jessie 8.0)\n* 64bit Mac OS X\n* 64bit Ubuntu (12.04 and 14.04)\n* iOS\n* Android\n* Pine64 (Debian Jessie 8.5, 3.10.102 BSP2)\n* Nvidia Jetson TX1 (use above Pine64 package)\n* Nvidia Jetson TX2 (use above Pine64 package)\n* Intel Edison (Ubilinux based on Debian Wheezy 7.8)\n* Samsung Artik (built with Fedora 25 for ARMv7)\n* ARM64 (aarch64, Ubuntu 16.04)\n\nIt ships in the form of a **C++ library** with language-dependent wrappers\ngenerated by SWIG. We welcome wrappers for new languages -- feel free to send a\npull request!\n\nCurrently we have built wrappers for:\n\n* Java/Android\n* Go (thanks to @brentnd)\n* Node (thanks to @evancohen and @nekuz0r)\n* Perl (thanks to @iboguslavsky)\n* Python\n* iOS/Swift3 (thanks to @grimlockrocks)\n* iOS/Object-C (thanks to @patrickjquinn)\n\nIf you want support on other hardware/OS, please send your request to\n[snowboy@kitt.ai](mailto:snowboy.kitt.ai)\n\nNote: **Snowboy does not support Windows** yet. Please build Snowboy on *nix platforms.\n\n## Pricing for Snowboy models\n\nHackers: free\n\n* Personal use\n* Community support\n\nBusiness: please contact us at [snowboy@kitt.ai](mailto:snowboy@kitt.ai)\n\n* Personal use\n* Commercial license\n* Technical support\n\n## Pretrained universal models\n\nWe provide pretrained universal models for testing purpose. When you test those\nmodels, bear in mind that they may not be optimized for your specific device or\nenvironment.\n\nHere is the list of the models, and the parameters that you have to use for them:\n\n* **resources/snowboy.umdl**: Universal model for the hotword \"Snowboy\". Set\nSetSensitivity to 0.5 for better performance.\n* **resources/alexa.umdl**: Universal model for the hotword \"Alexa\". Set\nSetSensitivity to 0.5, and preferably set ApplyFrontend (only works on Raspberry\nPi) to true. This model is depressed.\n* **resources/alexa/alexa_02092017.umdl**: Universal model for the hotword\n\"Alexa\". This is still work in progress. Set SetSensitivity to 0.15.\n* **resources/alexa/alexa-avs-sample-app/alexa.umdl**: Universal model for the\nhotword \"Alexa\" optimized for [Alexa AVS sample app](https://github.com/alexa/alexa-avs-sample-app).\nSet SetSensitivity to 0.6, and set ApplyFrontend (only works on Raspberry Pi)\nto true. This is so far the best \"Alexa\" model we released publicly, when\nApplyFrontend is set to true.\n\n## Precompiled node module\n\nSnowboy is available in the form of a native node module precompiled for:\n64 bit Ubuntu, MacOS X, and the Raspberry Pi (Raspbian 8.0+). For quick\ninstallation run:\n\n npm install --save snowboy\n\nFor sample usage see the `examples/Node` folder. You may have to install\ndependencies like `fs`, `wav` or `node-record-lpcm16` depending on which script\nyou use.\n\n## Precompiled Binaries with Python Demo\n* 64 bit Ubuntu [12.04](https://s3-us-west-2.amazonaws.com/snowboy/snowboy-releases/ubuntu1204-x86_64-1.2.0.tar.bz2)\n / [14.04](https://s3-us-west-2.amazonaws.com/snowboy/snowboy-releases/ubuntu1404-x86_64-1.2.0.tar.bz2)\n* [MacOS X](https://s3-us-west-2.amazonaws.com/snowboy/snowboy-releases/osx-x86_64-1.2.0.tar.bz2)\n* Raspberry Pi with Raspbian 8.0, all versions\n ([1/2/3/Zero](https://s3-us-west-2.amazonaws.com/snowboy/snowboy-releases/rpi-arm-raspbian-8.0-1.2.0.tar.bz2))\n* Pine64 (Debian Jessie 8.5 (3.10.102)), Nvidia Jetson TX1 and Nvidia Jetson TX2 ([download](https://s3-us-west-2.amazonaws.com/snowboy/snowboy-releases/pine64-debian-jessie-1.2.0.tar.bz2))\n* Intel Edison (Ubilinux based on Debian Wheezy 7.8) ([download](https://s3-us-west-2.amazonaws.com/snowboy/snowboy-releases/edison-ubilinux-1.2.0.tar.bz2))\n \nIf you want to compile a version against your own environment/language, read on.\n\n## Dependencies\n\nTo run the demo you will likely need the following, depending on which demo you\nuse and what platform you are working with:\n\n* SoX (audio conversion)\n* PortAudio or PyAudio (audio capturing)\n* SWIG 3.0.10 or above (compiling Snowboy for different languages/platforms)\n* ATLAS or OpenBLAS (matrix computation)\n\nYou can also find the exact commands you need to install the dependencies on\nMac OS X, Ubuntu or Raspberry Pi below.\n\n### Mac OS X\n\n`brew` install `swig`, `sox`, `portaudio` and its Python binding `pyaudio`:\n\n brew install swig portaudio sox\n pip install pyaudio\n\nIf you don't have Homebrew installed, please download it [here](http://brew.sh/). If you don't have `pip`, you can install it [here](https://pip.pypa.io/en/stable/installing/).\n\nMake sure that you can record audio with your microphone:\n\n rec t.wav\n\n### Ubuntu/Raspberry Pi/Pine64/Nvidia Jetson TX1/Nvidia Jetson TX2\n\nFirst `apt-get` install `swig`, `sox`, `portaudio` and its Python binding `pyaudio`:\n\n sudo apt-get install swig3.0 python-pyaudio python3-pyaudio sox\n pip install pyaudio\n \nThen install the `atlas` matrix computing library:\n\n sudo apt-get install libatlas-base-dev\n \nMake sure that you can record audio with your microphone:\n\n rec t.wav\n \nIf you need extra setup on your audio (especially on a Raspberry Pi), please see the [full documentation](http://docs.kitt.ai/snowboy).\n\n## Compile a Node addon\nCompiling a node addon for Linux and the Raspberry Pi requires the installation of the following dependencies:\n\n sudo apt-get install libmagic-dev libatlas-base-dev\n\nThen to compile the addon run the following from the root of the snowboy repository:\n\n node-pre-gyp clean configure build\n\n## Compile a Java Wrapper\n\n # Make sure you have JDK installed.\n cd swig/Java\n make\n\nSWIG will generate a directory called `java` which contains converted Java wrappers and a directory called `jniLibs` which contains the JNI library.\n\nTo run the Java example script:\n\n cd examples/Java\n make run\n\n## Compile a Python Wrapper\n\n cd swig/Python\n make\n\nSWIG will generate a `_snowboydetect.so` file and a simple (but hard-to-read) python wrapper `snowboydetect.py`. We have provided a higher level python wrapper `snowboydecoder.py` on top of that.\n \nFeel free to adapt the `Makefile` in `swig/Python` to your own system's setting if you cannot `make` it.\n\n## Compile a GO Wrapper\n\n\tcd examples/Go\n\tgo get github.com/Kitt-AI/snowboy/swig/Go\n\tgo build -o snowboy main.go\n\t./snowboy ../../resources/snowboy.umdl ../../resources/snowboy.wav\n\t\nExpected Output:\n\n```\nSnowboy detecting keyword in ../../resources/snowboy.wav\nSnowboy detected keyword 1\n```\n\nFor more, please read `examples/Go/readme.md`.\n\n## Compile a Perl Wrapper\n\n cd swig/Perl\n make\n\nThe Perl examples include training personal hotword using the KITT.AI RESTful APIs, adding Google Speech API after the hotword detection, etc. To run the examples, do the following\n\n cd examples/Perl\n\n # Install cpanm, if you don't already have it.\n curl -L https://cpanmin.us | perl - --sudo App::cpanminus\n\n # Install the dependencies. Note, on Linux you will have to install the\n # PortAudio package first, using e.g.:\n # apt-get install portaudio19-dev\n sudo cpanm --installdeps .\n\n # Run the unit test.\n ./snowboy_unit_test.pl\n\n # Run the personal model training example.\n ./snowboy_RESTful_train.pl \n\n # Run the Snowboy Google Speech API example. By default it uses the Snowboy\n # universal hotword.\n ./snowboy_googlevoice.pl [Hotword_Model]\n\n\n## Compile an iOS Wrapper\n\nUsing Snowboy library in Objective-C does not really require a wrapper. It is basically the same as using C++ library in Objective-C. We have compiled a \"fat\" static library for iOS devices, see the library here `lib/ios/libsnowboy-detect.a`.\n\nTo initialize Snowboy detector in Objective-C:\n\n snowboy::SnowboyDetect* snowboyDetector = new snowboy::SnowboyDetect(\n std::string([[[NSBundle mainBundle]pathForResource:@\"common\" ofType:@\"res\"] UTF8String]),\n std::string([[[NSBundle mainBundle]pathForResource:@\"snowboy\" ofType:@\"umdl\"] UTF8String]));\n snowboyDetector->SetSensitivity(\"0.45\"); // Sensitivity for each hotword\n snowboyDetector->SetAudioGain(2.0); // Audio gain for detection\n\nTo run hotword detection in Objective-C:\n\n int result = snowboyDetector->RunDetection(buffer[0], bufferSize); // buffer[0] is a float array\n\nYou may want to play with the frequency of the calls to `RunDetection()`, which controls the CPU usage and the detection latency.\n\nThanks to @patrickjquinn and @grimlockrocks, we now have examples of using Snowboy in both Objective-C and Swift3. Check out the examples at `examples/iOS/`, and the screenshots below!\n\n\"Obj-C \"Swift3\n\n\n## Compile an Android Wrapper\n\nFull README and tutorial is in [Android README](examples/Android/README.md) and here's a screenshot:\n\n\"Android\n\nWe have prepared an Android app which can be installed and run out of box: [SnowboyAlexaDemo.apk](https://github.com/Kitt-AI/snowboy/raw/master/resources/alexa/SnowboyAlexaDemo.apk) (please uninstall any previous one first if you installed this app before).\n\n## Quick Start for Python Demo\n\nGo to the `examples/Python` folder and open your python console:\n\n In [1]: import snowboydecoder\n \n In [2]: def detected_callback():\n ....: print \"hotword detected\"\n ....:\n \n In [3]: detector = snowboydecoder.HotwordDetector(\"resources/snowboy.umdl\", sensitivity=0.5, audio_gain=1)\n \n In [4]: detector.start(detected_callback)\n \nThen speak \"snowboy\" to your microphone to see whetheer Snowboy detects you.\n\nThe `snowboy.umdl` file is a \"universal\" model that detect different people speaking \"snowboy\". If you want other hotwords, please go to [snowboy.kitt.ai](https://snowboy.kitt.ai) to record, train and downloand your own personal model (a `.pmdl` file).\n\nWhen `sensitiviy` is higher, the hotword gets more easily triggered. But you might get more false alarms.\n\n`audio_gain` controls whether to increase (>1) or decrease (<1) input volume.\n\nTwo demo files `demo.py` and `demo2.py` are provided to show more usages.\n\nNote: if you see the following error:\n\n TypeError: __init__() got an unexpected keyword argument 'model_str'\n \nYou are probably using an old version of SWIG. Please upgrade. We have tested with SWIG version 3.0.7 and 3.0.8.\n\n## Advanced Usages & Demos\n\nSee [Full Documentation](http://docs.kitt.ai/snowboy).\n\n## Change Log\n\n**v1.2.0, 3/25/2017**\n\n* Added better Alexa model for [Alexa AVS sample app](https://github.com/alexa/alexa-avs-sample-app)\n* New decoder that works well for short hotwords like Alexa\n\n**v1.1.1, 3/24/2017**\n\n* Added Android demo\n* Added iOS demos\n* Added Samsung Artik support\n* Added Go support\n* Added Intel Edison support\n* Added Pine64 support\n* Added Perl Support\n* Added a more robust \"Alexa\" model (umdl)\n* Offering Hotword as a Service through ``/api/v1/train`` endpoint.\n* Decoder is not changed.\n\n**v1.1.0, 9/20/2016**\n\n* Added library for Node.\n* Added support for Python3.\n* Added universal model `alexa.umdl`\n* Updated universal model `snowboy.umdl` so that it works in noisy environment.\n\n**v1.0.4, 7/13/2016**\n\n* Updated universal `snowboy.umdl` model to make it more robust.\n* Various improvements to speed up the detection.\n* Bug fixes.\n\n**v1.0.3, 6/4/2016**\n\n* Updated universal `snowboy.umdl` model to make it more robust in non-speech environment.\n* Fixed bug when using float as input data.\n* Added library support for Android ARMV7 architecture.\n* Added library for iOS.\n\n**v1.0.2, 5/24/2016**\n\n* Updated universal `snowboy.umdl` model\n* added C++ examples, docs will come in next release.\n\n**v1.0.1, 5/16/2016**\n\n* VAD now returns -2 on silence, -1 on error, 0 on voice and >0 on triggered models\n* added static library for Raspberry Pi in case people want to compile themselves instead of using the binary version\n\n**v1.0.0, 5/10/2016**\n\n* initial release\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://snowboy.kitt.ai", "keywords": null, "license": "Apache-2.0", "maintainer": null, "maintainer_email": null, "name": "snowboy", "package_url": "https://pypi.org/project/snowboy/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/snowboy/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://snowboy.kitt.ai" }, "release_url": "https://pypi.org/project/snowboy/1.2.0b1/", "requires_dist": null, "requires_python": null, "summary": "Snowboy is a customizable hotword detection engine", "version": "1.2.0b1" }, "last_serial": 3088614, "releases": { "1.2.0b1": [ { "comment_text": "", "digests": { "md5": "fc86c35d5b186103df1bf74c6e23e064", "sha256": "b05f37d90616e61de197c16d02d5205647b396ea744804837b56c33a34569dc4" }, "downloads": -1, "filename": "snowboy-1.2.0b1.tar.gz", "has_sig": false, "md5_digest": "fc86c35d5b186103df1bf74c6e23e064", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5040033, "upload_time": "2017-06-07T04:30:55", "url": "https://files.pythonhosted.org/packages/86/fc/3a13408cb3b32abff1b0539f44fca02ca378d9077b11f0c95674f278f3de/snowboy-1.2.0b1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fc86c35d5b186103df1bf74c6e23e064", "sha256": "b05f37d90616e61de197c16d02d5205647b396ea744804837b56c33a34569dc4" }, "downloads": -1, "filename": "snowboy-1.2.0b1.tar.gz", "has_sig": false, "md5_digest": "fc86c35d5b186103df1bf74c6e23e064", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5040033, "upload_time": "2017-06-07T04:30:55", "url": "https://files.pythonhosted.org/packages/86/fc/3a13408cb3b32abff1b0539f44fca02ca378d9077b11f0c95674f278f3de/snowboy-1.2.0b1.tar.gz" } ] }