Вопрос

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.

Это было полезно?

Решение

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
});
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top