Kitt-AI / snowboy

Future versions with model training module will be maintained through a forked version here: https://github.com/seasalt-ai/snowboy
Other
3.11k stars 1.01k forks source link

Can we use KittyAi wake word engine as Sensory wake word engine does not work with Rpi zero? #432

Open sriranjanr opened 6 years ago

sriranjanr commented 6 years ago

More specifically I want to integrate snowboy wake word engine with C++ sample demo in AVS Alexa SDK. So how do I compile the C++ and C samples given here in the git?

sriranjanr commented 6 years ago

I get the following errors when I try to run demo.py on raspberry pi zero

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 JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock 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 detector = snowboydecoder.HotwordDetector(model, sensitivity=0.5) File "/home/pi/rpi-arm-raspbian-8.0-1.1.1/snowboydecoder.py", line 115, in init stream_callback=audio_callback) File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 750, in open stream = Stream(self, *args, kwargs) File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 441, in init self._stream = pa.open(arguments) IOError: [Errno -9997] Invalid sample rate

How shall I solve these?Please let me know.

sriranjanr commented 6 years ago

I was able to solve the jack server issue by using "jack_control start" command at the command prompt but now I am having invalid sample rate issue..how shall I solve the sample rate issue? My USB mic has a default sample rate of 44100 Hz.

sriranjanr commented 6 years ago

Now as snowboy needs 16000 sample rate, how and where do I convert the 44100 to 16000? Or could someone recommend a USB sound card supporting 16000 sample rate..?

sriranjanr commented 6 years ago

I also read that there are rate convert plugins like libsample rate with which we can set global converted sampling rates..I will try to use this library.

chenguoguo commented 6 years ago

This camera usually works: https://www.amazon.com/Sony-PlayStation-Camera-Bulk-Packaging-Pc/dp/B0072I2240/ref=sr_1_1?ie=UTF8&qid=1525826776&sr=8-1&keywords=ps3+eye+camera

Regarding the avs sdk, we will submit a PR later this month.

ayushcshah commented 5 years ago

I was also having the same issue with sample rate. I did started with a fresh copy of raspian stretch and make sure you do not run apt-get upgrade. Setup and run snowboy kittAI demp.py and check if it detects the word and then setup AVS with following sh files https://github.com/alexa/avs-device-sdk/files/2761089/scripts.zip