Domanda

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.

È stato utile?

Soluzione

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
});
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top