My goal is to capture audio from my mic from within a container and send it over mqtt.
To get this to work i’m using a python packaged called pyaudio to capture the audio. Which work fine on my desktop, but doesn’t work when i put the python script inside of a docker container i was working on. It won’t allow me to install to even install it.
I’m pretty sure that its pyaudio because i had a hard time install it on my desktop because it had many missing dependency in the pip install. When i remove pip install pyaudio i can install the add-on.
So i tried to add the original portaudio that pyaudio is a wrapper for and it didn’t seem to make any different.
Questions
Am i doing anything obviously wrong
Or is there another way i could grab audio from within a docker container
Or is there a way to see the errors that the docker container has when its installing. I didn’t see any errors inside home-assistant.log
#My Docker file
FROM %%BASE_IMAGE%%
ENV LANG C.UTF-8
# Copy data for add-on
COPY run.sh /
COPY index.py /
RUN chmod a+x /run.sh
RUN apk add --no-cache \
py-pip \
python \
python-dev \
portaudio-dev \
&& pip install -U pip \
&& pip install \
paho-mqtt \
pyaudio
CMD [ "/run.sh" ]
I might be answer your question wrong, but for the run/create command it create based on your
config values you set for the add-on. So i the audio attribute to pipe the devices forward to the container.
I haven’t worked with hass.io or it’s addons but docs say you can "go to the Hass.io panel and in the supervisor card click on “View logs”. This should bring you to a page with the logs of the supervisor. "
The dockerfile is standard and should run in docker separately if you create a container. You can try testing dockerfile outside has.io.