Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Assistant failing when playing back #438

Open
aravindjaimon opened this issue Jun 29, 2022 · 1 comment
Open

Assistant failing when playing back #438

aravindjaimon opened this issue Jun 29, 2022 · 1 comment

Comments

@aravindjaimon
Copy link

(env) aj@pi:~/GA $ googlesamples-assistant-audiotest 
/home/aj/GA/env/lib/python3.9/site-packages/cffi/cparser.py:163: UserWarning: Global variable 'stderr' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
  warnings.warn("Global variable '%s' in cdef(): for consistency "
/home/aj/GA/env/lib/python3.9/site-packages/cffi/cparser.py:163: UserWarning: Global variable '__stderrp' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern')
  warnings.warn("Global variable '%s' in cdef(): for consistency "
INFO:root:Starting audio test.
INFO:root:Recording samples.
INFO:root:Finished recording.
INFO:root:Playing back samples.
Traceback (most recent call last):
  File "/home/aj/GA/env/bin/googlesamples-assistant-audiotest", line 8, in <module>
    sys.exit(main())
  File "/home/aj/GA/env/lib/python3.9/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/aj/GA/env/lib/python3.9/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/aj/GA/env/lib/python3.9/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/aj/GA/env/lib/python3.9/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/aj/GA/env/lib/python3.9/site-packages/googlesamples/assistant/grpc/audio_helpers.py", line 390, in main
    stream.write(samples.pop(0))
  File "/home/aj/GA/env/lib/python3.9/site-packages/googlesamples/assistant/grpc/audio_helpers.py", line 317, in write
    buf = normalize_audio_buffer(buf, self.volume_percentage)
  File "/home/aj/GA/env/lib/python3.9/site-packages/googlesamples/assistant/grpc/audio_helpers.py", line 57, in normalize_audio_buffer
    buf = arr.tostring()
AttributeError: 'array.array' object has no attribute 'tostring'
(env) aj@pi:~/GA $ 

@electronicsuk
Copy link

open /home/aj/GA/env/lib/python3.9/site-packages/googlesamples/assistant/grpc/audio_helpers.py file change line 57
from buf = arr.tostring() to arr.tobytes().

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants