同步操作将从 Yihui Xiong/snowboy 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Note:
Install swig
. For Mac, do brew install swig
; for Ubuntu, do sudo apt-get install swig3.0
. Make sure your swig
version is at least 3.0.10
. You'll also need wget
to download files.
Go to swig/Android
and build swig wrappers for Snowboy:
cd swig/Android
make
To make for ARMv8 64bit:
make BIT=64
Ths will generate a cross-compiled library for ARM:
jniLibs/
├── arm64-v8a
│ └── libsnowboy-detect-android.so
└── armeabi-v7a
└── libsnowboy-detect-android.so
and a few Java wrapper files:
java
└── ai
└── kitt
└── snowboy
├── SnowboyDetect.java
├── snowboy.java
└── snowboyJNI.java
The generated .so
and .java
files are hyperlinked to the examples/Android/SnowboyAlexaDemo
folder.
Use Android Studio to open the project in examples/Android/SnowboyAlexaDemo
and run it.
Screenshot (say "Alexa" after clicking "Start"):
Don't forget to disable the "debug" option when releasing your Android App!
Note: If you need to copy the Android demo to another folder, please use the -RL
option of cp
to replace the relative symbol links with real files:
cp -RL SnowboyAlexaDemo Other_Folder
Note: The sample app will save/overwrite all audio to a file (recording.pcm
). Make sure you do not leave it on for a long time.
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.
The following issues have been fixed pushed to master
.
--stl=libc++
option此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。