googlesamples/assistant-sdk-python

AssertionError after running googlesamples-assistant-pushtotalk ...

Badbird5907 opened this issue · 1 comments

I am using a raspberry pi 4B and after following the instructions at https://developers.google.com/assistant/sdk/guides/service/python/embed/run-sample I ran this line: googlesamples-assistant-pushtotalk --project-id my-dev-project --device-model-id my-model with the project ID and the device ID and I get the following error:
Traceback (most recent call last): File "/home/pi/.local/bin/googlesamples-assistant-pushtotalk", line 6, in <module> from googlesamples.assistant.grpc.pushtotalk import main File "/home/pi/.local/lib/python2.7/site-packages/googlesamples/assistant/grpc/pushtotalk.py", line 40, in <module> from . import ( File "/home/pi/.local/lib/python2.7/site-packages/googlesamples/assistant/grpc/audio_helpers.py", line 25, in <module> import sounddevice as sd File "/home/pi/.local/lib/python2.7/site-packages/sounddevice.py", line 2777, in <module> _initialize() File "/home/pi/.local/lib/python2.7/site-packages/sounddevice.py", line 2745, in _initialize _check(_lib.Pa_Initialize(), 'Error initializing PortAudio') File "/home/pi/.local/lib/python2.7/site-packages/sounddevice.py", line 2651, in _check raise PortAudioError(errormsg, err, hosterror_info) sounddevice.PortAudioError: <exception str() failed> Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "/home/pi/.local/lib/python2.7/site-packages/sounddevice.py", line 2762, in _exit_handler assert _initialized >= 0 AssertionError Error in sys.exitfunc: Traceback (most recent call last): File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "/home/pi/.local/lib/python2.7/site-packages/sounddevice.py", line 2762, in _exit_handler assert _initialized >= 0 AssertionError

Have you tried use these commands to test whether your audio works?

# Play a test sound
speaker-test -t wav

# Record and play back some audio using ALSA command-line tools
arecord --format=S16_LE --duration=5 --rate=16000 --file-type=raw out.raw
aplay --format=S16_LE --rate=16000 --file-type=raw out.raw