You can upload local music to Spotify by going through the desktop app, but you'll need to sync it with your phone to listen ...
You can play Apple Music on a Sonos speaker by logging into your Apple Music account through the Sonos app.