Stereo or Mono with physical GPIO switch

Hi!

I want to build a smart speaker setup that’s can either work with a single speaker or two speakers for stereo.

Basically the pi, amp and DAC are all mounted to the back of the left speaker the right speaker is plugged into the amp on the back of the left speaker.

Most of the time it will be in stereo, but there will be times when I want to grab the left speaker (with everything mounted on the back) and just take it with me to another room for example. In that case I want to flick a physical switch on the back and have it output mono so it’s like a typical smart speaker.

I saw the plug-in stereotomono which sounds great, but can I control this from a GPIO switch on the pi??

Thanks for any advice or suggestions you can offer.