resin-io/musync

Name: musync

Owner: Resin.io

Description: Play your music in sync!

Created: 2015-02-20 13:20:47.0

Updated: 2017-12-18 05:56:34.0

Pushed: 2015-04-24 11:08:21.0

Homepage: null

Size: 304

Language: CoffeeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

MuSync

dependencies

Play your favourite music in sync with your Raspberry Pis.

Requirements

You'll need:

Installation
t clone https://github.com/resin-io/musync.git
t remote add resin git@git.resin.io:USERNAME/APPNAME.git
t push resin
How it works

MuSync Frontend Screenshot

The MuSync Frontend allows users to add a song by artist and song name, this is is synced to the Firebase datastore. The datastore holds the list of songs to play, which one is the current song, and the start time for the current song (in milliseconds).

Each devices watches the firebase datastore. When the MuSync clients receive a song to play, they search for that song in Grooveshark (see the Customisation section to learn how to change the backend) and play it accordingly.

MuSync includes an audio skew correction mechanism to ensure the song is played in sync between all your clients.

Customisation

You can customise the following aspects of MuSync with their corresponding environment variables.

You are highly encouraged to specifically tweak GRACE and SETUP_GRACE to match your internet connection capabilities. The defaults are based on a fairly slow internet speed (less than 10mb/s). If you have a faster connection, decrease the values for improved performance.

MAXIMUM_SKEW

Defaults to 250.

The maximum skew, in milliseconds, between track time and expected time in the track.

FIREBASE_URL

Defaults to https://musync.firebaseio.com.

The Firebase URL.

GRACE

Defaults to 5000.

Delay, in milliseconds, before starting to play to allow devices to synchronise.

SETUP_GRACE

Defaults to 8000.

The time given for initial playback to be setup, preventing the track from starting behind schedule.

BACKEND

Defaults to grooveshark.

MuSync currently works with Grooveshark, but you can easily change the backend to get the audio streams from another sources.

To do this, you must create an NPM package called musync-backend-<your backend name> that exposes a search() function that returns a readable stream to the callback:

search(Object song, Function callback)

After you have your backend module installed to your MuSync application, you can change the BACKEND environment variable to match your backend name, without the musync-backend- prefix.

Take a look at the default musync-backend-grooveshark for an example.

Caveats
Tests

Run the test suite by doing:

lp test
TODO
Contribute

Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:

lp lint
Support

If you're having any problem, please raise an issue on GitHub.

License

The project is licensed under the MIT license.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.