Commit ec1cb895 authored by Max-Ferdinand Suffel's avatar Max-Ferdinand Suffel
Browse files

fix

parent 5962d1eb
......@@ -192,7 +192,7 @@ var socket = io(EEG_SOCKET_SERVER);
socket.on('connection', function() {
socket.on('get-EEG', function (data) {
data = JSON.parse(data);
console.log(data.toString());
if (data.attention > 0 && data.meditation > 0) {
RefreshFrame();
var min_nbrPoints = 48;
......@@ -233,7 +233,7 @@ window.onload = function () {
MIDI.programChange(2, 89);
MIDI.programChange(3, 104);
MIDI.programChange(4, 1);
RefreshFrame();
// setInterval(RefreshFrame, 200);
},
callbackPCM: function (pcmBuffer) {
......
......@@ -199,7 +199,7 @@ if (window.AudioContext || window.webkitAudioContext) (function () {
// to hijack the raw PCM 16-bit audio data.
if (root.callbackPCM) {
if (!ctx.audioProcessor) {
ctx.audioProcessor = ctx.createScriptProcessor(0, 1, 1);
ctx.audioProcessor = ctx.createScriptProcessor(4096, 1, 1);
ctx.audioProcessor.onaudioprocess = function(e) {
var inputBuffer = e.inputBuffer.getChannelData(0);
root.callbackPCM(inputBuffer);
......
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