Apple's HomePod can do this: bump your phone on the speaker, and the sound magically moves from the phone's speaker to the speaker. Pretty cool.

Maybe one day Sonos will be able to do this as well. Until then, you can use NFC stickers from Alibaba and the Shortcuts app.