Apple is such a closed shop, it’s difficult to achieve what you want. At a stretch, it may be able to do what you want using Lyrion/LMS running on a Raspberry Pi with a suitable sound card and audio input to send audio to HomePods using its airbridge plugin, but that’s not for the technically faint-hearted