Want to sync up your music on multiple computers? This accomplishes exactly that - using only a simple Python server and a browser. Simply run the Python server, and open up a browser on each computer you want to sync up - that's it!
This program is powered by the excellent howler.js library from goldfire. Essentially all the client computers sync their clocks and then try to start a song at the same time. Any dissimilarities between playback are also fixed, because the clients will automatically seek to the position of the server.
Tested on Python2.7 and Python3.4. To install simply use
git clone https://github.com/schollz/sync-music-player.git
python setup.py installStart the server using
python syncmusic.py "C:/Your/folder/of/music"which should print out something like
############################################################
# Starting server with 18 songs
# To use, open a browser to http://W.X.Y.Z:5000
############################################################Your server is up and running! Now, for each computer that you want to play music from, just go and load up a browser to the url http://W.X.Y.Z:5000. You will see the playlist and the music will automatically synchronize and start playing!
- If you don't hear anything, the client is probably trying to synchronize. The browser automatically mutes when it goes out of sync to avoid the headache caused by mis-aligned audio. You can see synchronization progress in your browser console.
- If you still dont' hear anything, and you're using Chrome browser on Android you need change one of the flags in chrome to allow audio without gestures. To do this, copy and paste this into your Chrome browser:
chrome://flags/#disable-gesture-requirement-for-media-playback- If you want to play music from a Raspberry Pi, just type this command (works on headless):
xinit /usr/bin/midori -a http://W.X.Y.Z:5000- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
- James Simpson and Goldfire studios for their amazing howler.js library
- Zach Simpson for his paper on simple clock synchronization