I am trying to create an interface with an external server, and don't know where to start. I would need to take audio as input to my computer, and send it to the remote server as a chunked HTTP request. The API that I'm trying to connect to is described here p1-5


I have never worked with audio programmatically, so don't know what would be the most straightforward way to go about this? Are there solutions that exist out there that already do this?

I've come across references to Shoutcast, VLC, Icecast, FFMPeg, Darkice, but I don't know if those are appropriate for what I'm trying to accomplish or not.

2 Answers 2


IceCast, ShoutCast and the like aren't going to help you except in that they employ the ffmpeg library to do their encoding and stream utility functions.

You'll need to download the ffmpeg library it is written in c but has wrappers written most languages if you are not comfortable writing in native c code. You will also want to check out the ffmpeg develper docs.

Do not, I mean it DO NOT attempt to do the encoding yourself unless you already are extremely comfortable with this procedure or have a LOT of time to spend on this. Use the standard PCM encoding that is offered by ffmpeg.


It looks like you need to encode your audio as 8KHz 16-bit PCM, then split it into 260ms chunks and send those one at a time to the service. The actual encoding method for the data isn't specified, I'd start with converting the samples to network byte order then stick the octets into the request as UTF-8 and see if that works.

  • 1
    Why, why, why would somebody do this as HTTP? Can anybody come up with a reason that doesn't give me massive heartburn?
    – jamesson
    Mar 17, 2013 at 3:54
  • The reasons you might stream audio over HTTP are similar to the reasons for protocols like HLS that stream video over HTTP. Apr 16, 2013 at 1:27
  • If I was doing something as part of a medical application in the NHS (UK), I would do it over HTTP or HTTPS, simply because that way you know the ports will be unblocked over the network. Anything else, and you are creating 6 months of paperwork pain (and cost) Sep 23, 2013 at 9:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.