No, it doesn't need the same audio files on each device or even across the internet; it can be done with hotspot sharing between devices. or something called DLNA or the same thins.
Music is from my phone. We connect our devices with a hotspot, then my device tries to send you a current song, and while both are synced, they can play together.
you can test it with SoundSeeder - Synced Music - Apps on Google Play
mh