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
141 stars 65 forks source link

Can't find get the device index for ReSpeaker Mic Array v2.0 with pyaudio #21

Closed jundengdeng closed 5 years ago

jundengdeng commented 5 years ago

Hi there,

I am having a problem to get the device index number of Mic Array on my Ubuntu PC. Basically, I followed the instruction from http://wiki.seeedstudio.com/ReSpeaker_Mic_Array_v2.0/#applications The code get_index.py is shown as follows:

import pyaudio

p = pyaudio.PyAudio()
info = p.get_host_api_info_by_index(0)
numdevices = info.get('deviceCount')

for i in range(0, numdevices):
        if (p.get_device_info_by_host_api_device_index(0, i).get('maxInputChannels')) > 0:
            print "Input Device id ", i, " - ", p.get_device_info_by_host_api_device_index(0, i).get('name')

sudo is used when the code is run. System environment:

OS: Ubuntu 18.04 Python: 3.6 with anaconda

Can you please give some suggestions to fix this issue? Thanks!

Best, Jun

jundengdeng commented 5 years ago

It's solved. The problems is due to the anaconda environment. The following may help others:

cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25 ~/anaconda3/lib/
rm ~/anaconda3/lib/libstdc++.so 
ln -s ~/anaconda3/lib/libstdc++.so.6.0.25 ~/anaconda3/lib/libstdc++.so 
# reintall pyaudio
conda remove pyaudio
conda install -c anaconda pyaudio #