Skip to content

Commit

Permalink
Updated README.md to reflect the recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chenguoguo committed Jun 4, 2016
1 parent bf89391 commit 9928607
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 5 deletions.
56 changes: 52 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ by [KITT.AI](http://kitt.ai).
[Full Documentation](https://snowboy.kitt.ai/docs)


Version: 1.0.2 (5/24/2016)
Version: 1.0.3 (6/4/2016)

Snowboy is a customizable hotword detection engine for you to create your own
hotword like "OK Google" or "Alexa". It is powered by deep neural networks and has the following properties:
Expand All @@ -26,12 +26,14 @@ Currently Snowboy supports:
* all versions of Raspberry Pi (with Raspbian based on Debian Jessie 8.0)
* 64bit Mac OS X
* 64bit Ubuntu (12.04 and 14.04)
* iOS
* Android

It ships in the form of a **C library** with **Python** wrappers generated by SWIG. We welcome wrappers for other languages -- feel free to send a pull request!
It ships in the form of a **C library** with language-dependent wrappers generated by SWIG. We welcome wrappers for new languages -- feel free to send a pull request!

If you want support on other hardware/OS, please send your request to [[email protected]](mailto:snowboy.kitt.ai)

## Precompiled Binaries
## Precompiled Binaries with Python Demo
* 64 bit Ubuntu [12.04](https://s3-us-west-2.amazonaws.com/snowboy/snowboy-releases/ubuntu1204-x86_64-1.0.2.tar.bz2)
/ [14.04](https://s3-us-west-2.amazonaws.com/snowboy/snowboy-releases/ubuntu1404-x86_64-1.0.2.tar.bz2)
* [MacOS X](https://s3-us-west-2.amazonaws.com/snowboy/snowboy-releases/osx-x86_64-1.0.2.tar.bz2)
Expand Down Expand Up @@ -84,7 +86,47 @@ SWIG will generate a `_snowboydetect.so` file and a simple (but hard-to-read) py
Feel free to adapt the `Makefile` in `swig/Python` to your own system's setting if you cannot `make` it.


## Quick Start
## Compile an iOS Wrapper

Using 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`.

To initialize Snowboy detector in Objective-C:

snowboy::SnowboyDetect* snowboyDetector = new snowboy::SnowboyDetect(
std::string([[[NSBundle mainBundle]pathForResource:@"common" ofType:@"res"] UTF8String]),
std::string([[[NSBundle mainBundle]pathForResource:@"snowboy" ofType:@"umdl"] UTF8String]));
snowboyDetector->SetSensitivity("0.45"); // Sensitivity for each hotword
snowboyDetector->SetAudioGain(2.0); // Audio gain for detection

To run hotword detection in Objective-C:

int result = snowboyDetector->RunDetection(buffer[0], bufferSize); // buffer[0] is a float array

You may want to play with the frequency of the calls to `RunDetection()`, which controls the CPU usage and the detection latency.

## Compile an Android Wrapper

cd swig/Android
# Make sure you set up the NDKROOT variable in Makefile before you run.
make

Using Snowboy library on Android devices is a little bit tricky. We have compiled Snowboy using Android's cross-compilation toolchain for ARMV7 architecture, see the library here `lib/android/armv7a/libsnowboy-detect.a`. We then use SWIG to generate the Java wrapper, and use Android's cross-compilation toolchain to generate the corresponding JNI libraries. After running `make`, two directories will be created: `java` and `jniLibs`. Copy these two directories to your Android app directory (e.g., `app/src/main/`) and you should be able to call Snowboy funcitons within Java.

To initialize Snowboy detector in Java:

# Assume you put the model related files under /sdcard/snowboy/
SnowboyDetect snowboyDetector = new SnowboyDetect("/sdcard/snowboy/common.res",
"/sdcard/snowboy/snowboy.umdl");
snowboyDetector.SetSensitivity("0.45"); // Sensitivity for each hotword
snowboyDetector.SetAudioGain(2.0); // Audio gain for detection

To run hotword detection in Java:

int result = snowboyDetector.RunDetection(buffer, buffer.length); // buffer is a short array.

You may want to play with the frequency of the calls to `RunDetection()`, which controls the CPU usage and the detection latency.

## Quick Start for Python Demo

Go to the `examples/Python` folder and open your python console:

Expand Down Expand Up @@ -120,6 +162,12 @@ See [Full Documentation](https://snowboy.kitt.ai/docs).

## Change Log

**v1.0.3, 6/4/2016**

* Updated universal `snowboy.umdl` model to make it more robust in non-speech environment.
* Fixed bug when using float as input data.
* Added library support for Android ARMV7 architecture.

**v1.0.2, 5/24/2016**

* Updated universal `snowboy.umdl` model
Expand Down
2 changes: 1 addition & 1 deletion swig/Android/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
SWIG := swig

# Please specify your NDK root directory here.
NDKROOT := /Users/guoguo/Tools/android-ndk-r11c/
NDKROOT :=
APILEVEL := 17

SNOWBOYDETECTSWIGITF = snowboy-detect-swig.i
Expand Down

0 comments on commit 9928607

Please sign in to comment.