On-demand audio streaming

Tag: web-services , rest , audio-streaming , playlist Author: micheel8888 Date: 2011-10-30

Has anyone come across a software that can dynamically stream an arbitrary source identified by an HTTP URL.

I am looking for a server based software that can expose a RESTful interface to take in the definition of the playlist and respond back with a stream URL, that would playback the playlist. The sound files in the playlist are located on a different system accessible via HTTP.

I did take a look at liquidsoap project, but couldnt figure out how to wrap that into a RESTful webservice.

You want the playlist (of arbitrary audio files hosted on HTTP servers) to be played back on the server and assembled into a stream for playback at the client?
@Brad, Yes, thats correct. Exactly what I am after. I also need to transcode any audio format into low bandwidth MP3, but that is secondary.
If I were you, I'd wrap something up with Ices and then use Icecast/SHOUTcast for the server. It already does all of this. You'd just need to call it from some script on your web server.
Thanks Brad; good shout!
Liquidsoap does provide http get/post etc handlers, see here: savonet.sourceforge.net/doc-svn/harbor_http.html But as the answer below says you may want to write some of this in another language and call out from Liquidsoap if necessary.

Best Answer

It would be quite a hassle to implement a RESTful server in liquidsoap. I would build the RESTful webservice in whatever "ordinary" web programming language, like PHP, and then let liquidsoap call the same service to get the tracks/files. In this example, a GET request to should return one http url to a mp3/ogg/whatever.

(Example code for liquidsoap version 1.0 - this example will not run on earlier 0.x-something versions)

def autopilot() =
  def result()
    result =

radio =

output.icecast(%mp3(samplerate=44100, stereo=true, bitrate=128),

In this example, you would need an icecast2 server to send the stream to.