Connecting microphone to container(s) (HomeAssistant, Wyoming)

If you want an offline voice assistant in HomeAssistant, you would usually install the wyoming-whisper, wyoming-piper and wyoming-openwakeword addons. Since on TrueNAS HomeAssistant runs in a container rather than directly on a host, you can’t install addons inside of HA. Instead you have to run these service somewhere else and then connect them to HA over the network.

So I tried to do that by creating 3 custom apps from those images:

which is working fine and I can successfully add them to HomeAssistant using the Wyoming-Protocol Integration.

But now I somehow have to connect my microphone to it and that is where I’m stuck. Has anyone here done this before and can give me some advice?

I’m using a USB mic btw.

“Solved” the issue by adding another container based on:

Since there is no way to pass through a specific device in a custom app, I had to check the Privileged option. I got it to work by adding these arguments:

  • –vad
  • –vad-trigger-level
  • 1
  • –vad-threshold
  • 0.6
  • –debug
  • –mic-command
  • arecord -D plughw:0,0 -r 16000 -c 1 -f S16_LE -t raw
  • –snd-command
  • aplay -D plughw:1,0 -r 22050 -c 1 -f S16_LE -t raw