简体   繁体   中英

Invalid Sample Rate Error When Starting Google Assistant Sample on RPi 3

I tried to install the new Google Assistant SDK on my RPi 3 model B following the instructions on the Google page made for this specific device and software ( https://developers.google.com/assistant/sdk/overview ). I followed the directions and successfully configured my microphone (Kinobo USB mic https://www.amazon.com/Kinobo-Microphone-Desktop-Recognition-Software/dp/B00IR8R7WQ ) to work.

However, upon running of the startup command:

python -m googlesamples.assistant

I get the error:Traceback (most recent call last):

File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
File "/home/pi/env/lib/python3.4/site-
    packages/googlesamples/assistant/audio_helpers/__main__.py", line 94, 
    in <module>
    main()
File "/home/pi/env/lib/python3.4/site-packages/click/core.py", line 
    722, in __call__
    return self.main(*args, **kwargs)
File "/home/pi/env/lib/python3.4/site-packages/click/core.py", line 
    697, in main
    rv = self.invoke(ctx)
File "/home/pi/env/lib/python3.4/site-packages/click/core.py", line 
    895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
File "/home/pi/env/lib/python3.4/site-packages/click/core.py", line 
    535, in invoke
    return callback(*args, **kwargs)
File "/home/pi/env/lib/python3.4/site-
    packages/googlesamples/assistant/audio_helpers/__main__.py", line 
    67, in main
    flush_size=audio_flush_size)
File "/home/pi/env/lib/python3.4/site-
    packages/googlesamples/assistant/audio_helpers/__init__.py", line 
    140, in __init__
    blocksize=int(block_size/2),  # blocksize is in number of frames.
File "/home/pi/env/lib/python3.4/site-packages/sounddevice.py", line 
    1491, in __init__
    **_remove_self(locals()))
File "/home/pi/env/lib/python3.4/site-packages/sounddevice.py", line 
    1017, in __init__
    'Error opening {0}'.format(self.__class__.__name__))
File "/home/pi/env/lib/python3.4/site-packages/sounddevice.py", line 
    2671, in _check
    raise PortAudioError(msg)
    sounddevice.PortAudioError: Error opening RawStream: Invalid 
    sample rate

I don't understand why it is throwing an invalid sample rate and upon trying to trace through the error, I did not come upon a variable or magic number that denotated the sample rate. Any ideas on how I can fix this error?

Did you try steps 2 and 3 under "Configure and Test the Audio"? I had the same problem and that cleared it up for me. It works great now.

The link for "Configure and Test Audio" is:

https://developers.google.com/assistant/sdk/prototype/getting-started-pi-python/configure-audio

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM