[Icecast] get current song

"Thomas B. Rücker" thomas at ruecker.fi
Mon Feb 3 10:50:13 UTC 2014


On 02/03/2014 09:38 AM, SK wrote:
> Hi,
> I use dynamic playlist, so do not have static list of files. I sream
> this play list on my mage via simple flash player,
> and show this playlist in this page with ajax-ed javascript.
>
> Here is question.
>
> I need to get current song,
> but when I ask icecast server I get wrong information. Sometimes song
> is still playing,
> but info from server is updated to next track. 

The info is absolutely correct from the server point of view. At that
point in time the server is already sending the next song to clients.
Why you hear something different is because your listening client has a
significantly sized cache to avoid buffer underruns (which is mostly a
good thing).

> I have many short
> (3-5-10 seconds) tracks in my play list,
> so this difference is critical for me.
>
> What can I do with it?

Then polling the server for current playing song is unsuitable for you.
You'll have to find a player that reads the metadata from the stream AND
does it in sync with the buffer. If it doesn't do the latter, you'll
still face the same problem.

I'd try out browser playback. Works very well for ogg/vorbis and should
also start working for opus streams on most browsers now.
There is a javascript api to get metadata.

Please note, that just adding 'delay' to presenting metadata is NOT a
viable solution, as the buffer size may differ and also clients fall
behind differently and there might commonly be a delay of anywhere from
2 to 60s.

Cheers

Thomas




More information about the Icecast mailing list