You can easily add Spotify to your Sonos speaker system by adding a new music service in the Sonos app.
You can play Apple Music on a Sonos speaker by logging into your Apple Music account through the Sonos app.