I am trying to run a python app that uses a respeaker microphone on RPI3. The app works when i run in on the device but i am not able to access the microphone when i run the app inside a container.
Here is the docker command i use to run the container app:
docker run -i -t myimageid
I am not able to find the device inside the container app, here is a code snippet i am using:
from pyaudio import *
print("=================Looking for sound devices =======================")
p = PyAudio()
for i in range(p.get_device_count()):
name = p.get_device_info_by_index(i)[‘name’]
if ‘seeed-4mic’ in name:
audio_device_index = i
print(‘Using audio input device %d: %s’ % (i, name))
break
else:
print(name)
Is there a way i can access a microphone device in a container app? i read little bit about --device switch but it didn’t work.
This is what i tried:
docker run -i -t myimageid --device