Skip to main content
August 13, 2010
Question

How to Stream live Audio and metadata

  • August 13, 2010
  • 1 reply
  • 839 views

Helo there,

i'm trying to build some kind of online radio. Therefore i'll be streaming audio (mp3) in real time.

Ok,  so here's my problem: i have a play-list on my server and the idea is  for this play-list to play all day long, but on the client side  the user can only do play and stop the music.

The problem is  when one music stops and the next one starts i need the server to send  not only the new audio but also all the info about this file: duration,  author and music name, this way my player can show a play /stop and all  the info about the current music playing.

Until now i've only come across with video live streaming, but very  little information on how to do a live transmission of audio.

ps: the only info on streaming audio that i've found so far is about  audio on demand, but the way i want things to happen the client can't  chose the music.

any ideas?

__________________

thanks in advance!

Marco Monteiro

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    August 16, 2010

    I think you can use Server-side Stream object to create a playlist and other functions on server-side.

    Basically you can add your mp3 files to be played, basically just their names to an array object, and on the fly update it.

    Now take first file from the array and create the playlist and keep on adding new files from the names array.

    Also you can define onPlayStatus on your stream object to track when one song finishes and other starts.

    Also since you have names of the files, you can set an interval based on current song's duration which would get triggered and send information to client of next song to be played. For this you can use onId3 method as mp3 files would not have metadata defined.