Question

I need to read somehow stream from my shoutcast server containing VU meter data which looks like this

"0xa5 leftVal rightVal 0xa5 leftVal ..... etc"

Stream is continuous.

I'd like to receive this data and parse it in JavaScript(jQuery) to manage VU meters animations.

Was it helpful?

Solution

For continuous stream processing, maybe this answer will help: Process a continuous stream of JSON

For parsing the data use the built in javascript split function. You could then use the jQuery each function to iterate over the array.

var items = dataStream.split(" ");

$.each(items, function(index, value) {
  //Do stuff
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top