I got a continuous stream of byte data receiving from websocket. When I view the data with this function:
document.getElementById('log').innerHTML = document.getElementById('log').innerHTML + msg + "<br />";
It would look like this:
-0.00005645785104823496
0.00000906544783255643
-0.001234972515485563
0.00000008534781277461
.
.
.
I want to fill it in an array that would look like
var inp = new Array(event.data)
, arr = new Float32Array()
;
for(var i = 0;i <arr.length; i++) {
arr[i] = inp[i];
}
How do I fill the inp[i] array with data receiving from websocket.
Thanks
I found the answer, it was:
shifted = inp.shift();
Thank you for any help.