Git Product home page Git Product logo

assistant-sample's Issues

Error opening RawStream: Device unavailable [PaErrorCode -9985]

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]

Running Hotword.py

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'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.