Commit 59e85365 authored by Karan Goel's avatar Karan Goel
Browse files

very basic sound modification

parent 948bd427
......@@ -57,7 +57,8 @@ var SoundCloudAudioSource = function(player) {
// calculate an overall volume value
var total = 0;
for (var i = 0; i < 80; i++) { // get the volume from the first 80 bins, else it gets too loud with treble
total += self.streamData[i];
if (!player || !player.eegData) player.eegData.eegPower = self.streamData[i];
total += (self.streamData[i] + player.eegData.eegPower.beta) / 2;
}
self.volume = total;
};
......@@ -594,10 +595,6 @@ window.onload = function init() {
var socket = io();
socket.on('data', function(data) {
console.log(data);
});
var visualizer = new Visualizer();
var player = document.getElementById('player');
var uiUpdater = new UiUpdater();
......@@ -623,6 +620,11 @@ window.onload = function init() {
audioSource: audioSource
});
socket.on('data', function(data) {
// console.log(data);
player.eegData = data;
});
uiUpdater.toggleControlPanel();
// on load, check to see if there is a track token in the URL, and if so, load that automatically
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment