Skip to content

Instantly share code, notes, and snippets.

@alexeybondarenko
Last active August 8, 2017 20:25
Show Gist options
  • Save alexeybondarenko/7e2f60802827516d9531b74c65984af1 to your computer and use it in GitHub Desktop.
Save alexeybondarenko/7e2f60802827516d9531b74c65984af1 to your computer and use it in GitHub Desktop.
// WEBSOCKETS
var socketUrl = 'ws://' + location.hostname + ':3001';
var client = new BinaryClient(socketUrl);
var MIDIStream = null;
client.on('open', function () {
MIDIStream = client.createStream();
MIDIStream.on('data', handleReceiveAudioData);
MIDIStream.on('end', handleEndAudioStream);
});
function handleReceiveAudioData(data) {
console.log('receive audio data', data);
}
function handleEndAudioStream(data) {
console.log('end', data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment