kitt-ai / snowboy Goto Github PK
View Code? Open in Web Editor NEWFuture versions with model training module will be maintained through a forked version here: https://github.com/seasalt-ai/snowboy
License: Other
Future versions with model training module will be maintained through a forked version here: https://github.com/seasalt-ai/snowboy
License: Other
"Removed support for the armeabi-v7a-hard ABI",
maybe add a comment somewhere, it took me a few moments to realize
First, big thx for your lib ^^.
But I have a strange bug, I can't understand, compiled on raspberry.
snowboy::SnowboyDetect detector(resource_filename, model_filename);
if (setlocale(LC_ALL, "fr_FR") == NULL) setlocale(LC_ALL, "fr_FR.utf8");
Works fine but
if (setlocale(LC_ALL, "fr_FR") == NULL) setlocale(LC_ALL, "fr_FR.utf8");
snowboy::SnowboyDetect detector(resource_filename, model_filename);
Give
ERROR (ConvertStringToFloat():snowboy-utils.cc:149) ConvertStringToFloat: only part of the string can be converted: 0.1
terminate called after throwing an instance of 'std::runtime_error'
what(): ERROR (ConvertStringToFloat():snowboy-utils.cc:149) ConvertStringToFloat: only part of the string can be converted: 0.1
[stack trace: ]
./jarvis() [0x4431c]
./jarvis() [0x4495c]
./jarvis() [0x3a7a8]
./jarvis() [0x3ecf8]
./jarvis() [0x3f2d8]
./jarvis() [0x20284]
./jarvis() [0x1930c]
/lib/arm-linux-gnueabihf/libc.so.6(__libc_start_main+0x114) [0xb6a14294]
Hi, I have take a look on your project, it s working perfectly, but I have some problem to use it in a C application.
Apparently the library is in C at the start but the header file is only for c++ project (in the include folder).
And I have some problem to convert it, have you a C example too ?
I'm trying to install snowboy on Ubuntu 16.04 LTS and get this when I run demo.py. This happens with both python3 and 2.
~/Downloads/ubuntu1404-x86_64-1.0.4$ sudo python3 demo.py resources/Marvin.pmdl
Traceback (most recent call last):
File "demo.py", line 1, in <module>
import snowboydecoder
File "/home/rithvik/Downloads/ubuntu1404-x86_64-1.0.4/snowboydecoder.py", line 5, in <module>
import snowboydetect
File "/home/rithvik/Downloads/ubuntu1404-x86_64-1.0.4/snowboydetect.py", line 28, in <module>
_snowboydetect = swig_import_helper()
File "/home/rithvik/Downloads/ubuntu1404-x86_64-1.0.4/snowboydetect.py", line 24, in swig_import_helper
_mod = imp.load_module('_snowboydetect', fp, pathname, description)
File "/usr/lib/python3.5/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: /home/rithvik/Downloads/ubuntu1404-x86_64-1.0.4/_snowboydetect.so: undefined symbol: cblas_sgemm
Any ideas?
EDIT: ubuntu1404-x86_64-1.0.4 is just the extracted tar for Ubuntu.
A swig java library would simplify the workflow for java projects.
Hello everyone, I'm having a little problem, whenever I'm trying to use snowboyy I get this error
||PaMacCore (AUHAL)|| Error on line 2466: err='-10863', msg=Audio Unit: cannot do in current context
Assertion failed: (!err), function AudioIOProc, file src/hostapi/coreaudio/pa_mac_core.c, line 2467
can somebody help me with that?
Hi Guys,
First of all, absolutely love the library, using it for a smart home and it's literally the way I get everything to work. I actually run this on a pi 3 which is the interface to all the cool stuff. However I develop on windows (mounted samba from the pi), but unfortunately, I can't test locally first and I have to keep running on the pi and its a bit of a pain. Is there any likelihood that you guys will get it running on windows?
Really so much love for all you've done though, keep up the great work! :D
Getting snowboy integrated into the AlexaPi project :)
However there seems to be quite verbose logging printing to stdout I get INFO:snowboy:Silence
every 100ms or so.
How do I turn off/adjust the output?
When's your web site is coming back online? I need to generate new voice commands.
For testing, I would like to record my voice and give the recorded sample to snowboy for testing my script without having to speak into my microphone everytime.
On pocket_sphinx continus there is an option to do that
pocketsphinx_continuous -infile file.wav
Sorry if this is posted in the wrong place but there was a typo on the hotword detail page. 'notify' http://imgur.com/a/ss1OF
Hey guys,
I was going through the set up again and found I needed to set the hw value to get rec t.wav
to work. I pasted in the settings doc'd in the "Set up audio" here: https://snowboy.kitt.ai/docs, but that says to save the file as .asound
not .asoundrc
which did work.
The current link to your docs leads to a 404
After successfully building from source, I'm running the demo, but ran into this error:
pi@raspberrypi:~/Downloads/snowboy/examples/Python $ python demo.py ./resources/snowboy.umdl
Traceback (most recent call last):
File "demo.py", line 27, in <module>
detector = snowboydecoder.HotwordDetector(model, sensitivity=0.5)
File "/home/pi/Downloads/snowboy/examples/Python/snowboydecoder.py", line 91, in __init__
resource_filename=resource, model_str=model_str)
TypeError: __init__() got an unexpected keyword argument 'model_str'
Lines 90s in snowboydecoder.py
:
self.detector = snowboydetect.SnowboyDetect(
resource_filename=resource, model_str=model_str) # 91
self.detector.SetAudioGain(audio_gain)
self.num_hotwords = self.detector.NumHotwords()
But looking at snowboydetect.py, the constructor takes a pointer, so I'm not sure what it is complaining about. My python skills aren't great.
class SnowboyDetect(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SnowboyDetect, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SnowboyDetect, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _snowboydetect.new_SnowboyDetect(*args)
try: self.this.append(this)
except: self.this = this
Hi guys,
I had the snowboy demo working just fine for me but after tinkering around with things I've managed to break it somehow and can't figure out why. This is what I get when I run the demo script with a personal model:
Expression 'paTimedOut' failed in 'src/os/unix/pa_unix_util.c', line: 387 Expression 'PaUnixThread_New( &stream->thread, &CallbackThreadFunc, stream, 1., stream->rtSched )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2998 Expression 'pthread_join( self->thread, &pret )' failed in 'src/os/unix/pa_unix_util.c', line: 441
There's also the usual ALSA and jack server could not be started errors but these were there before too and didn't cause any issues. The quoted error is the new one.
Any help would be appreciated - thanks.
Just to let you know that the documentation on the website is not up to date concerning the demo code.
It is showing
detector.start(detected_callback=snowboydecoder.ding_callback, interrupt_check=interrupt_callback, sleep_time=0.03)
Where it changed to
snowboydecoder.play_audio_file
Great tool !
Hi, I can't get the current version of snowboy (as published on npm) working. Running examples/node/microphone.js
crashes with node: symbol lookup error: .../node_modules/snowboy/lib/node/binding/Release/node-v48-linux-x64/snowboy.node: undefined symbol: cblas_sdot
I've made sure I have libatlas-base-dev installed, but I thought I wouldn't need it because of the precompiled binaries.
Also, manually compiling by running node-pre-gyp --build-from-source
doesn't resolve the issue.
I can reproduce this with the following example on Ubuntu 16.04.
const record = require('node-record-lpcm16');
const snowboy = require('snowboy');
const models = new snowboy.Models();
models.add({
file: 'resources/snowboy.umdl',
hotwords: 'snowboy'
});
const detector = new snowboy.Detector({
resource: 'resources/common.res',
models
});
record.start().pipe(detector);
Hi, I m using your engine in a C++ project (for the moment it's more C) without problems, but I need to use a trick to reduce false positive.
It's perhaps due to microphone but if a record the word "momomo" I have a trigger when I say "tatata" (even with 0.5 sensitivity).
IDK how work your algorithm, but what can I do to choose a better Hotword. Its better to use long word/short word more vowel/more consonant, simple word+blank+simple word, ...
thanks for your excellent product.
Build environment:
$PATH:
king@wks:
/Downloads/snowboy-master/swig/Android$ $PATH/Downloads/snowboy-master/swig/Android$
bash: /home/king/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/king/AndroidDevelop/android-studio-sdk/android-sdk-linux/platform-tools:/home/king/AndroidDevelop/android-studio-sdk/android-sdk-linux/tools:/home/king/AndroidDevelop/swig_tool/bin:/home/king/AndroidDevelop/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin: No such file or directory
king@wks:
I follow your step to build Android library by below:
cd swig/Android
Make sure you set up the NDKROOT variable in Makefile before you run.
We have only tested with NDK version r11c.
make
but I got an error like this:
OpenBLAS-0.2.18/version.h
OpenBLAS: Detecting fortran compiler failed. Cannot compile LAPACK. Only compile BLAS.
make[1]: Entering directory/home/king/Downloads/snowboy-master/swig/Android/OpenBLAS-Android' make[2]: Entering directory
/home/king/Downloads/snowboy-master/swig/Android/OpenBLAS-Android/interface'
arm-linux-androideabi-gcc -O2 -DMAX_STACK_ALLOC=2048 -Wall -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACKE -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=4 -marm -mfpu=neon -mfloat-abi=hard -march=armv7-a -Wl,--no-warn-mismatch -DASMNAME=saxpy -DASMFNAME=saxpy_ -DNAME=saxpy_ -DCNAME=saxpy -DCHAR_NAME="saxpy_" -DCHAR_CNAME="saxpy" -DNO_AFFINITY -I.. -I. -UDOUBLE -UCOMPLEX -c axpy.c -o saxpy.o
arm-linux-androideabi-gcc -O2 -DMAX_STACK_ALLOC=2048 -Wall -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACKE -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=4 -marm -mfpu=neon -mfloat-abi=hard -march=armv7-a -Wl,--no-warn-mismatch -DASMNAME=sswap -DASMFNAME=sswap_ -DNAME=sswap_ -DCNAME=sswap -DCHAR_NAME="sswap_" -DCHAR_CNAME="sswap" -DNO_AFFINITY -I.. -I. -UDOUBLE -UCOMPLEX -c swap.c -o sswap.o
arm-linux-androideabi-gcc -O2 -DMAX_STACK_ALLOC=2048 -Wall -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACKE -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=4 -marm -mfpu=neon -mfloat-abi=hard -march=armv7-a -Wl,--no-warn-mismatch -DASMNAME=scopy -DASMFNAME=scopy_ -DNAME=scopy_ -DCNAME=scopy -DCHAR_NAME="scopy_" -DCHAR_CNAME="scopy" -DNO_AFFINITY -I.. -I. -UDOUBLE -UCOMPLEX -c copy.c -o scopy.o
arm-linux-androideabi-gcc -O2 -DMAX_STACK_ALLOC=2048 -Wall -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACKE -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=4 -marm -mfpu=neon -mfloat-abi=hard -march=armv7-a -Wl,--no-warn-mismatch -DASMNAME=sscal -DASMFNAME=sscal_ -DNAME=sscal_ -DCNAME=sscal -DCHAR_NAME="sscal_" -DCHAR_CNAME="sscal" -DNO_AFFINITY -I.. -I. -UDOUBLE -UCOMPLEX -c scal.c -o sscal.o
copy.c:39:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
make[2]: *** [scopy.o] Error 1
make[2]: *** Waiting for unfinished jobs....
axpy.c:39:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
make[2]: *** [saxpy.o] Error 1
scal.c:39:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
swap.c:39:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
make[2]: *** [sscal.o] Error 1
make[2]: *** [sswap.o] Error 1
make[2]: Leaving directory/home/king/Downloads/snowboy-master/swig/Android/OpenBLAS-Android/interface' make[1]: *** [libs] Error 1 make[1]: Leaving directory
/home/king/Downloads/snowboy-master/swig/Android/OpenBLAS-Android'
make: [OpenBLAS-Android/install/lib/libopenblas.a] Error 1 (ignored)
arm-linux-androideabi-g++ -O3 --sysroot=/home/king/AndroidDevelop/android-ndk-r11c//platforms/android-17/arch-arm -shared -std=c++0x -rdynamic -I../../ -Wl,--fix-cortex-a8 -Wl,--no-warn-mismatch -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wno-sign-compare -Wa,--noexecstack -Wformat -Werror=format-security -fno-rtti -ffunction-sections -funwind-tables -fstack-protector-strong -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -fno-strict-aliasing -mthumb -no-canonical-prefixes -march=armv7-a -mfpu=vfpv3-d16 -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -DANDROID -c snowboy-detect-swig.cc -o snowboy-detect-swig.o
snowboy-detect-swig.cc:848:18: fatal error: string: No such file or directory
#include
^
compilation terminated.
make: *** [snowboy-detect-swig.o] Error 1
Could you provide a step in details about how to do it on Android platform, because I have no idea how to get information about snowboy, I have searched on internet, but no helps get.
In addition, could you provide the compiled android library and upload to this github project?
appreciate for your reply.
when i try to run interactively as suggested, i get this error:
>>> detector = snowboydecoder.HotwordDetector("resources/snowboy.umdl", sensitivity=0.5, audio_gain=1) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "snowboydecoder.py", line 91, in __init__ resource_filename=resource, model_str=model_str) TypeError: __init__() got an unexpected keyword argument 'model_str'
it looks to me like snowboydecoder is sending in kwargs, but snowboydetect expects args?
" g++ -I../../ -O3 -fPIC -std=c++0x -shared snowboy-detect-swig.o
../..//lib/ubuntu64/libsnowboy-detect.a -L/usr/local/lib/python2.7/config -lpthread -ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic -lm -ldl -lf77blas -lcblas -llapack_atlas -latlas -o _snowboydetect.so
/usr/bin/ld: /usr/local/lib/python2.7/config/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/python2.7/config/libpython2.7.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [_snowboydetect.so] Error 1 "
I am following the exact steps provided in the git documentation. I navigate to "swig/Python" and compile ( make ). I get the above make error. Any solutions for this??
so, if I try to use a pmdl, I get This error. I tried running python with sudo and as a normal user.
Hey, i'm new to developing with python, and am having trouble installing package with provided binary. When i uncompress the Raspberry Pi binary provided on the site I don't see a setup.py to use to install the package. Am I just supposed to run the script through the folder? I usually just install packages through pip so please excuse me if this a very simple question.
make: python-config: Command not found
make: python-config: Command not found
g++ -I../../ -O3 -fPIC -std=c++0x -c snowboy-detect-swig.cc
snowboy-detect-swig.cc:154:21: fatal error: Python.h: No such file or directory
^
compilation terminated.
Makefile:45: recipe for target 'snowboy-detect-swig.o' failed
make: *** [snowboy-detect-swig.o] Error 1
Any help figuring out what I'm doing wrong ?
Got it built for the pi, inside a venv. Super cool! However, although I'm able to run the demo with python 2.7, it fails when I try to run it using Python 3.4 (the default inside my virtual env).
Traceback (most recent call last):
File "demo.py", line 1, in <module>
import snowboydecoder
File "/home/pi/jarvis/snowboy/examples/Python/snowboydecoder.py", line 5, in <module>
import snowboydetect
File "/home/pi/jarvis/snowboy/examples/Python/snowboydetect.py", line 28, in <module>
_snowboydetect = swig_import_helper()
File "/home/pi/jarvis/snowboy/examples/Python/snowboydetect.py", line 24, in swig_import_helper
_mod = imp.load_module('_snowboydetect', fp, pathname, description)
File "/usr/lib/python3.4/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
ImportError: dynamic module does not define init function (PyInit__snowboydetect)
I followed these instructions regarding getting it compiled:
#17
Hi guys, great work!
have big Interest in snowboy and I've got it working on a Raspi with PS3 eye.
Problem is: after each reboot, ps3 eye isn't working. lsusb shows it, but no rec possible until I unplug and plug the Cam.
After days of testing and searching I'm now hoping for a little hint for configuring the cam correct.
uname -r shows 4.4.11+
OS is a raspian jessie 2016-05-10 with dist-upgrade
many greetings Michael
Hi!
I'm currently using the python library and spawning a child process for snowboy in Electron to detect my hotwords, and it works pretty well!
I've noticed that you guys recently added the Node library so I wanted to update my code for better flexibility.
While adding the example code
const { Models, Detector } = require("snowboy");
Electron throws an error of
cannot find module /Users/user/node_modules/snowboy/lib/node/binding/Release/electron-v1.4-darwin-x64/snowboy.node'
Any ideas?
I write a demo tool to use "hotword detection" function, but I encountered a crash when create a SnowboyDetect object, error msg is:
W/art (11495): Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
E/art (11495): No implementation found for long ai.kitt.snowboy.snowboyJNI.new_SnowboyDetect(java.lang.String, java.lang.String) (tried Java_ai_kitt_snowboy_snowboyJNI_new_1SnowboyDetect and Java_ai_kitt_snowboy_snowboyJNI_new_1SnowboyDetect__Ljava_lang_String_2Ljava_lang_String_2)
D/AndroidRuntime(11495): Shutting down VM
E/AndroidRuntime(11495): FATAL EXCEPTION: main
E/AndroidRuntime(11495): Process: com.wistron.demo.tool.snowboy_demo, PID: 11495
E/AndroidRuntime(11495): java.lang.UnsatisfiedLinkError: No implementation found for long ai.kitt.snowboy.snowboyJNI.new_SnowboyDetect(java.lang.String, java.lang.String) (tried Java_ai_kitt_snowboy_snowboyJNI_new_1SnowboyDetect and Java_ai_kitt_snowboy_snowboyJNI_new_1SnowboyDetect__Ljava_lang_String_2Ljava_lang_String_2)
E/AndroidRuntime(11495): at ai.kitt.snowboy.snowboyJNI.new_SnowboyDetect(Native Method)
E/AndroidRuntime(11495): at ai.kitt.snowboy.SnowboyDetect.(SnowboyDetect.java:39)
E/AndroidRuntime(11495): at com.wistron.demo.tool.snowboy_demo.MainActivity.onCreate(MainActivity.java:16)
E/AndroidRuntime(11495): at android.app.Activity.performCreate(Activity.java:5933)
E/AndroidRuntime(11495): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
E/AndroidRuntime(11495): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
E/AndroidRuntime(11495): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
E/AndroidRuntime(11495): at android.app.ActivityThread.access$800(ActivityThread.java:144)
E/AndroidRuntime(11495): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
E/AndroidRuntime(11495): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(11495): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(11495): at android.app.ActivityThread.main(ActivityThread.java:5219)
E/AndroidRuntime(11495): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(11495): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(11495): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
E/AndroidRuntime(11495): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
W/ActivityManager( 828): Force finishing activity com.wistron.demo.tool.snowboy_demo/.MainActivity
My code snippet as below:
Java code:
// Assume you put the model related files under /sdcard/snowboy/ SnowboyDetect snowboyDetector = new SnowboyDetect("/storage/emulated/legacy/common.res", "/storage/emulated/legacy/snowboy.umdl"); snowboyDetector.SetSensitivity("0.45"); // Sensitivity for each hotword snowboyDetector.SetAudioGain(2.0f); // Audio gain for detection short[] buffer = new short[1024]; int result = snowboyDetector.RunDetection(buffer, buffer.length); // buffer is a short array.
I have pushed common.res and snowboy.umdl files to Android internal storage root folder. those files come from snowboy-master/resources/
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.wistron.demo.tool.snowboy_demo"> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
thanks in advance!
Im trying to start a python script upon raspberry pi start.
I have edited my root crontab file ( sudo crontab -e)
Ive asked cron to start the python script as well as the .pmdl file.
my crontab looks like
@ reboot /location_of_file/pythonscript.py Hotword.pmdl
the python script is starting, but but the startup error file for the script says that the .pmdl file is not found.
Am I going about this the right way? is there a special way i have to get snowboy started upon startup? or should it just work the same way it does using the command line.
Do i need to write a supplemental script to run the python file, and open the PMDL file at the same time?
Hi,
im trying to add snowboy to a personal assistant app i've been working on but to be able to record the audio i first need to terminate all recording streams from snowboy otherwise i get an Audio Deivce Busy Error.
After accessing detector.terminate() I can finally record my command and the python file processes it correctly. My only problem is, that while the prog loops detector.start(...) does not work anymore.
Is there a way to reenable detector.start(...) so snowboy listens for the Hotword and then kill everything with detector.terminate() (And so on and on)?
Thanks :)
Hello again,
After git clone of snowboy, I did:
cd swig/Python
make
And got these errors:
pi@raspberrypi:~/Downloads/snowboy/swig/Python $ make
make: python-config: Command not found
make: python-config: Command not found
swig -I../../ -c++ -python -o snowboy-detect-swig.cc snowboy-detect-swig.i
make: swig: Command not found
Makefile:45: recipe for target 'snowboy-detect-swig.cc' failed
make: *** [snowboy-detect-swig.cc] Error 127
I was able to get around this by running
pip install python-config
sudo apt-get install python-dev swig
Question though.... I see the set up section uses swig3.0. But when I ran make, it couldn't find swig until I installed just swig
. Is there an issue with installing these 3
version of things? I see it also in the python3-pyaudio
.
Hi - great software!
I have your demo working with Ubuntu. What I'd like to do is detect the keyword in continuous speech in a similar way to the Amazon echo. Is that possible? For example, this:
"Alexa, turn on the lights"
instead of
"Alexa" [ding] "turn on the lights"
Ideally, I'd also want to know where in the audio the keyword was spoken so that it can be removed from audio before I send it to an online engine (such as api.ai or AVS).
Any suggestions would be great.
Thanks
Hi! This is great and I have a raspberry Pi 3 and this is way cool. However I would like to write a demo with iOS for you and then do a pull request. However getting it working is another story... I have the libsnowboy-detect.a library installed into my xCode project but I am getting an error in my header import which I have coded like so:
"File not found" although I added it to build phases... If you can point me in the right direction I will write a nice demo... or just be eternally grateful
I am working on getting snowboy to invoke a python script to activate the listening on Amazon's Alexa For Raspberry Pi. I am stuck at this error: Error Given
Is there going to be Windows support anytime soon? Because it wont work with my RPi
Hey guys!
Great stuff! This is pretty much exactly what I was trying to build! But you guys are way further than I ever would have gotten. Er, but I didn't get very far.
I'm running this on a raspberry pi model B with a Cyber Acoustics USB microphone. I can successfully record something using AUDIODEV=hw:1,0 rec t.wav
.
Anyway, when attempting the demo with this command:
pi@raspberrypi:~/Downloads/snowboy $ python demo.py ./resources/snowboy.umdl
I get a bunch of garbage from ALSA that is apparently just warnings. But the last bit dumps this:
Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2048
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self->primeBuffers, hwParamsCapture, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2719
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2843
Traceback (most recent call last):
File "demo.py", line 27, in <module>
detector = snowboydecoder.HotwordDetector(model, sensitivity=0.5)
File "/home/pi/Downloads/snowboy/snowboydecoder.py", line 115, in __init__
stream_callback=audio_callback)
File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 750, in open
stream = Stream(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 441, in __init__
self._stream = pa.open(**arguments)
IOError: [Errno -9997] Invalid sample rate
I saw this while playing with another voice recognition and I was able to get past it by passing a sample rate. Is there an easy way to pass sample rate to your decoder?
For reference, here is the get_device_count dump:
import pyaudio
p = pyaudio.PyAudio()
for i in range(p.get_device_count()):
print p.get_device_info_by_index(i)
Output: (formatted for reading!)
{
'defaultSampleRate': 44100.0,
'defaultLowOutputLatency': 0.005804988662131519,
'defaultLowInputLatency': -1.0,
'maxInputChannels': 0 L,
'structVersion': 2 L,
'hostApi': 0 L,
'index': 0,
'defaultHighOutputLatency': 0.034829931972789115,
'maxOutputChannels': 2 L,
'name': u 'bcm2835 ALSA: - (hw:0,0)',
'defaultHighInputLatency': -1.0
} {
'defaultSampleRate': 44100.0,
'defaultLowOutputLatency': 0.005804988662131519,
'defaultLowInputLatency': -1.0,
'maxInputChannels': 0 L,
'structVersion': 2 L,
'hostApi': 0 L,
'index': 1,
'defaultHighOutputLatency': 0.034829931972789115,
'maxOutputChannels': 2 L,
'name': u 'bcm2835 ALSA: IEC958/HDMI (hw:0,1)',
'defaultHighInputLatency': -1.0
} {
'defaultSampleRate': 48000.0,
'defaultLowOutputLatency': -1.0,
'defaultLowInputLatency': 0.007979166666666667,
'maxInputChannels': 2 L,
'structVersion': 2 L,
'hostApi': 0 L,
'index': 2,
'defaultHighOutputLatency': -1.0,
'maxOutputChannels': 0 L,
'name': u 'Cyber Acoustics USB device: Audio (hw:1,0)',
'defaultHighInputLatency': 0.032
} {
'defaultSampleRate': 44100.0,
'defaultLowOutputLatency': 0.005804988662131519,
'defaultLowInputLatency': -1.0,
'maxInputChannels': 0 L,
'structVersion': 2 L,
'hostApi': 0 L,
'index': 3,
'defaultHighOutputLatency': 0.034829931972789115,
'maxOutputChannels': 128 L,
'name': u 'sysdefault',
'defaultHighInputLatency': -1.0
} {
'defaultSampleRate': 44100.0,
'defaultLowOutputLatency': 0.005804988662131519,
'defaultLowInputLatency': -1.0,
'maxInputChannels': 0 L,
'structVersion': 2 L,
'hostApi': 0 L,
'index': 4,
'defaultHighOutputLatency': 0.034829931972789115,
'maxOutputChannels': 128 L,
'name': u 'default',
'defaultHighInputLatency': -1.0
} {
'defaultSampleRate': 48000.0,
'defaultLowOutputLatency': 0.021333333333333333,
'defaultLowInputLatency': -1.0,
'maxInputChannels': 0 L,
'structVersion': 2 L,
'hostApi': 0 L,
'index': 5,
'defaultHighOutputLatency': 0.021333333333333333,
'maxOutputChannels': 2 L,
'name': u 'dmix',
'defaultHighInputLatency': -1.0
}
So I have Snowboy working nicely on Ubuntu 16.04 LTS, however when I try and run it on Xubtunu 16.04 via one of the demos, I get the error below. I haven't changed anything in your Make file, and installed Swig from source. Is the .a lib tied to 12.04 and 14.04?
Traceback (most recent call last): File "test.py", line 1, in <module> import snowboydecoder File "/home/robin/projects/dyson_mm_demo/third_party/snowboy/examples/Python/snowboydecoder.py", line 11, in <module> import snowboydetect File "/home/robin/projects/dyson_mm_demo/third_party/snowboy/examples/Python/snowboydetect.py", line 28, in <module> _snowboydetect = swig_import_helper() File "/home/robin/projects/dyson_mm_demo/third_party/snowboy/examples/Python/snowboydetect.py", line 24, in swig_import_helper _mod = imp.load_module('_snowboydetect', fp, pathname, description) ImportError: /home/robin/projects/dyson_mm_demo/third_party/snowboy/examples/Python/_snowboydetect.so: undefined symbol: _ZNK7snowboy13SnowboyDetect14GetSensitivityB5cxx11Ev
I get this error on Ubuntu 14.04 any time I try to start any python program.
So, the FAQ on this page:
Has this statement:
* My pmdl model works well for me, but does not work well for others
Models with suffix pmdl are personal models, and they are supposed to only work well for the person who provides the audio samples. If you are look for a model that works well for everyone, please use the universal model (with suffix umdl).
Which indicates to me that if I train my pmdl, then my girlfriend won't be able to initiate. I suppose I could pass multiple pmdl files to the snowboydecoder.HotwordDetector
and use the same callback for each pmdl. But ideally, I'd be able to have each person generate a pmdl then pass that to the script.
But then, if I have guests over, and I want to use a term different from "snowboy", could I do this? Is there any way through your api to generate an umdl?
i need GPIO relay On-Off script based on two models. same as demo2.py but the script should be work as follows.
if anyone can make script like this i would really appreciate. Thanks in Advance..
Awesome project guys, I'm the author of the orignal RaspberryPi Alexa project :)
I'm looking at integrating your code into AlexaPi, one thing I need to work out is silence detection, have you got any tips?
The flow would need to go WakeWord>Record Command>DETECT END OF COMMAND>Post to Alexa Voice Service.
Hi,
Any plans for windows precompiled binaries ?
Ok, so I set up a new Debian x64 box and installed node v6.7.0:
$ node --version
v6.7.0
Then did:
cd
mkdir snowboytest
npm install --save snowboy
Everything installed successfully as far as I could tell. So based on the example, I came up with this code with the appropriate directories changed:
const record = require('node-record-lpcm16');
const snowboy = require( 'snowboy' );
//const {Detector, Models} = require('../../');
const Detector = snowboy.Detector;
const Models = snowboy.Models;
const models = new Models();
models.add({
file: './node_modules/snowboy/resources/snowboy.umdl',
sensitivity: '0.5',
hotwords : 'snowboy'
});
const detector = new Detector({
resource: "./node_modules/snowboy/resources/common.res",
models: models,
audioGain: 2.0
});
detector.on('silence', function () {
console.log('silence');
});
detector.on('sound', function () {
console.log('sound');
});
detector.on('error', function () {
console.log('error');
});
detector.on('hotword', function (index, hotword) {
console.log('hotword', index, hotword);
});
const mic = record.start({
threshold: 0,
verbose: true
});
mic.pipe(detector);
But when I run it:
pi@alphared-agent-virtual2:~/snowboytest$
pi@alphared-agent-virtual2:~/snowboytest$ node microphone.js
Recording with sample rate 16000...
Recording 12288 bytes
node: symbol lookup error: /home/pi/snowboytest/node_modules/snowboy/lib/node/binding/Release/node-v48-linux-x64/snowboy.node: undefined symbol: cblas_sdot
I'm not sure if it is related or not, but when running the examples directly, I got an error trying to find the file..:
pi@alphared-agent-virtual2:~/snowboy/node_modules$ cd snowboy/examples/Node/
pi@alphared-agent-virtual2:~/snowboy/node_modules/snowboy/examples/Node$ node microphone.js
/home/pi/snowboy/node_modules/snowboy/lib/node/index.js:27
throw new Error(`Model ${model.file} does not exists.`);
^
Error: Model resources/snowboy.umdl does not exists.
at HotwordModels.add (/home/pi/snowboy/node_modules/snowboy/lib/node/index.js:27:19)
at Object.<anonymous> (/home/pi/snowboy/node_modules/snowboy/examples/Node/microphone.js:6:8)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
There is no source available for the static libraries. You're asking everyone to trust what it contained in those libraries.
Would love to incorporate this in a project im working on https://github.com/kunal732/MacLexa. Would it be possible to incorporate this into a swift mac app ?
Hi guys,
Love Snowboy, been using it for a while now for a voice-activated dashboard of sorts on my RPi at home. The problem I have though is that I seem to be getting a lot of false triggers whenever I turn the TV on. I've moved the mic further away from the TV, I'm using a personal model that was recorded using the RPi as well, so I think the obvious fronts are covered.
My question was, is there a way to adjust for background noise when instantiating a HotWordDetector? I feel like I had seen some code with a method like that months ago when initially looking into Snowboy, but I can't find anything like it now.
I'd appreciate letting me know if there is any such function, and if not, any other tips you guys might have to reduce false positives when there's some background noise (sleep time values, model adjustments, etc.).
Thanks a lot!
I'm unable to make the python wrapper on my opensuse machine.
Specifically, I run into an error with 3 libraries (f77blas, lapack_atlas, and atlas):
>>> make
g++ -I../../ -O3 -fPIC -std=c++0x -L/usr/lib64/ -shared snowboy-detect-swig.o \
../..//lib/ubuntu64/libsnowboy-detect.a -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -lm -ldl -lf77blas -lcblas -llapack_atlas -latlas -o _snowboydetect.so
/usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/bin/ld: cannot find -lf77blas
/usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/bin/ld: cannot find -llapack_atlas
/usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/bin/ld: cannot find -latlas
collect2: error: ld returned 1 exit status
make: *** [Makefile:51: _snowboydetect.so] Error 1
One thing I did was add '-L/usr/lib64' as an additional flag in the hopes of finding these libraries, and that did work for cblas, but unfortunately that doesn't seem to have worked for the remaining 3.
Does anyone have an idea of what the issue may be? Do I need to compile blas, lapack and atlas on my own!? I would rather not...
I'm using Raspberry Pi3 with raspbian for implementation.
When running the python demo, comes the error messages as follow:
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
Listening. . . Press Ctrl + C to exit
I have followed the instructions on https://snowboy.kitt.ai/docs to modify the .asoundrc file. I am not able to figure out the problems here. Is it something about alsa configuration or the port audio settings?
Hello and thanks for the awesome job.
I was trying to create an NPM module for snowboy, but I kind of lost.
So, it might be easier to work together. If anyone could write simple C++ file to use snowboy, I can help with wrapping it as a javascript module and putting it in npm.
Or if anyone wants to go all the way, here are the directions to create c++ addons: https://nodejs.org/api/addons.html
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.