Audio switcher with API

Hi,

I would like to connect two devices to my Sonos connect. I think the best solution is to use a switcher. Something like this:
https://www.amazon.co.uk/STEREO-Manual-Speaker-selector-available/dp/B073GWCRP3/
But I would like to avoid having to manually switch the source. Does anyone know of an automatic switcher or one that is supported by home assistant?

Thanks

Maybe what you need is a audio mixer. I use this simple one. The advantage is that you don’t need to switch audio sources. This way my alexa can annouce something over the other audio sources.

That sounds great. Does it detect the source playing? I would expect interference, because I understand that two sources can be playing at the same time (don’t need this)?

no, it’s a dumb machine, it just plays all the sources at once if all the input devices are playing. Maybe that is not what you want in your use case. You should ground the mixer to reduce interference though (there’s a ground port on the back off the mixer).

If only one input is playing it is exactly the same as if it were directly plugged in?

yes indeed