React Native Snowboy hotword detection engine.
Purpose
A hotword detection engine for Android.
Setup
- Install Module
npm install --save react-native-snowboy
- In
android/settings.gradle
...include ':react-native-snowboy'project(':react-native-snowboy').projectDir = new File(settingsDir, '../node_modules/react-native-snowboy')
- In
android/app/build.gradle
dependencies { ... compile project(':react-native-snowboy')}
- In MainApplication.java
... // <-------- Add this to import package
- In YourProject/android/app/src/main/assets
Create snowboy folder and put inside it the files alexa.umdl (or your own umdl or umdl file) and common.res. You can get these files here https://github.com/Kitt-AI/snowboy/tree/master/examples/Android/SnowboyAlexaDemo/assets/snowboy
Usage
Currently there following functionality available.
- initHotword
- startRecording
- stopRecording
- destroy
Importing module
let snowboy =
initHotword()
Init the engine.
Example
{ snowboy }
startRecording() and stopRecording()
Example
{ ifthisstateisRecording snowboy; this else snowboy; this this}
destroy()
Destroy the engine.
Example
{ snowboy;}
Events
Use event listeners to do whatever you want when the hotword is detected
Example
{ // No hotword detected snowboy // No speech: silence snowboy // The hotword is decteced snowboy}
LICENSE
MIT