blacklight / assistant-sample Goto Github PK
View Code? Open in Web Editor NEWWrapper around Google's pushtotalk.py for assistant interaction without the google-assistant-library
License: MIT License
Wrapper around Google's pushtotalk.py for assistant interaction without the google-assistant-library
License: MIT License
When I run assistant_sample.py everything works fine. But when I run hotword_sample.py and say a hot word, the program crashes:
python3 hotword_sample.py
INFO:snowboy:Keyword 1 detected at time: 2020-06-14 19:22:37
Expression 'ret' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1736
Expression 'AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1904
Expression 'PaAlsaStreamComponent_Initialize( &self->capture, alsaApi, inParams, StreamDirection_In, NULL != callback )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2171
Expression 'PaAlsaStream_Initialize( stream, alsaHostApi, inputParameters, outputParameters, sampleRate, framesPerBuffer, callback, streamFlags, userData )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2840
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/home/pi/assistant-sample/assistant/hotword.py", line 68, in run
self.detector.start(detected_callback=self.hotword_detected())
File "/home/pi/assistant-sample/snowboydecoder.py", line 221, in start
callback()
File "/home/pi/assistant-sample/assistant/hotword.py", line 62, in callback
self.assistant.start_conversation()
File "/home/pi/assistant-sample/assistant/__init__.py", line 200, in start_conversation
self._init_assistant()
File "/home/pi/assistant-sample/assistant/__init__.py", line 107, in _init_assistant
flush_size=self.audio_flush_size
File "/home/pi/.local/lib/python3.7/site-packages/googlesamples/assistant/grpc/audio_helpers.py", line 190, in __init__
blocksize=int(block_size/2), # blocksize is in number of frames.
File "/home/pi/.local/lib/python3.7/site-packages/sounddevice.py", line 1345, in __init__
**_remove_self(locals()))
File "/home/pi/.local/lib/python3.7/site-packages/sounddevice.py", line 861, in __init__
'Error opening {0}'.format(self.__class__.__name__))
File "/home/pi/.local/lib/python3.7/site-packages/sounddevice.py", line 2653, in _check
raise PortAudioError(errormsg, err)
sounddevice.PortAudioError: Error opening RawStream: Device unavailable [PaErrorCode -9985]
I am having trouble running the hotword script, I have entered the path to my model file but it keeps saying no module named snowboy, even though I have sent the 3 wav files to the server successfully. See below terminal output, any help would be appreciated.
(env) pi@raspberrypi:~ $ python /home/pi/assistant-sample/hotword_sample.py
Traceback (most recent call last):
File "/home/pi/assistant-sample/assistant/hotword.py", line 7, in
import snowboydecoder
ModuleNotFoundError: No module named 'snowboydecoder'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/assistant-sample/hotword_sample.py", line 2, in
from assistant.hotword import HotwordService
File "/home/pi/assistant-sample/assistant/hotword.py", line 9, in
import snowboy.snowboydecoder as snowboydecoder
ModuleNotFoundError: No module named 'snowboy'
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.