I would aim to have speakers at least 2 m (6.5 feet) away from the helm compass
But it's easy to confirm whether you're getting interference
... make note of your compass readings, then bring the speakers aboard and check for changes. You can also try moving the speakers toward the compass to see how much influence the speaker has and at what distance. Or test with a pocket compass.
Does anyone still "swing" their compass, or pay a pro to do so? That's the gold standard for detecting and factoring out any remaining magnetic influence.
Good "shielded" speakers are still available - look at some of the small monitor
speakers sold for home studios, for example.