respeaker / usb_4_mic_array

ReSpeaker 4 Mic Array with builtin VAD, DOA, AEC, Beamforming & NS
https://www.seeedstudio.com/ReSpeaker-Mic-Array-v2.0-p-3053.html
Apache License 2.0
142 stars 66 forks source link

Tuning.py (AttributeError: 'array.array' object has no attribute 'tostring') #49

Open Retroman445 opened 3 years ago

Retroman445 commented 3 years ago

Running tuning.py gives me this error.

Traceback (most recent call last):
  File "tuning.py", line 197, in <module>
    main()
  File "tuning.py", line 181, in main
    print('{:24} {}'.format(name, dev.read(name)))
  File "tuning.py", line 109, in read
    response = struct.unpack(b'ii', response.tostring())
AttributeError: 'array.array' object has no attribute 'tostring'

Solved it by changing this line

response = struct.unpack(b'ii', response.tostring())

to this

response = struct.unpack(b'ii', response)

DavidGoedicke commented 3 years ago

Just made a pull request to address this issue.

See #54 .

goldyfruit commented 2 years ago

I got the same issue, and @DavidGoedicke's PR worked for me.