Multi-channel audio using node.js
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
static
.gitignore
README.md
config.example.js
master.html
multi
package.json
slave.html
slave_mobile.html

README.md

node-multi

Distributed audio performance using node.js, socket.io and the HTML5 WebAudio API.

Install

 npm install
 mkdir static
 mkdir static/audio

Note that you'll have to put your IP address in master.html, slave.html and slave_mobile.html (this will be templated in the future). You can either edit the included config file to point to remote mp3 files or drop your own mp3 files in static/audio that will be served with Express (see issues).

Web Audio is currently supported in Google Chrome, desktop Safari, Mobile Safari (on iOS 6) and the WebKit nightlies, I believe.

TODO: fix latency issues (possibly via multiple ping and latency compensation), use nginx to serve static content

Issues

Latency

There are significant issues with clients beginning play at different times, sometimes up to 500 ms. I'm actively working on this. Currently, when a client loads the page it will phone home to the server 10 times and calculate the average latency. When the master sends a play event, each client requests a latency-adjusted play event from the server, which is currently 1000 ms minus the individual recorded client latency. Currently nothing is being done to account for latency. Working on it.

Static file serving

I had some problems with Express getting overwhelmed serving large mp3s to many clients. Might be better to use remote files, hence the included config.example.js.

License