I want to provide audio data into SHOUTcast or Icecast servers without using their own broadcaster, since i will be using this on various platforms including mobile.
I need protocol descriptions, open source projects, or samples to be able to send audio data (from mic or file) using Objective-C, C or C++ to SHOUTcast and Icecast servers.
Where can I find the information needed to build a proper SHOUTcast/Icecast source client?
Comment: It's about time someone makes a SHOUTcast source client for mobile. I've been needing this for a while, but don't have time to build it, so kudos to you. Please make an Android version at some point.
The first thing you should do is download Wireshark.
Start the packet capture, fire up a SHOUTcast server, then fire up a source client, and connect it to the server. Be prepared for the horrifying simplicity of this protocol.
CrLf
(or \r\n
).If the password is wrong, it will say invalid password
or something like that. If it is correct, you're going to get something like this:
OK2
icy-caps:11
Note that each line has CrLf
after it, and after these two headers are sent, there are a pair of CrLf
.
Now, it is up to the source client to send a bunch of headers: icy-name
, icy-genre
, icy-pub
, icy-br
, icy-url
, icy-irc
, icy-icq
, icy-aim
, content-type
. Send them like this:
icy-name:My Awesome Station
Each line should be followed by CrLf
, and after you're done sending all of the headers, send a pair of CrLf
.
Once this is all done, start sending your stream data! No need to start in any particular spot, just send data. It is up to the clients on the receiving end to sync to the frame. The SHOUTcast server is completely "dumb" to the traffic flowing through it. You can connect with a Telnet client and send a bunch of text if you wanted to.
So, you're probably wondering how you send information for the next track and what not. The funny thing is, this is completely out-of-band from the connection where you send audio data.
All you have to do is make a web request to the port base (8000 in our example):
http://yourserver:8000/admin.cgi?pass=yourpassword&mode=updinfo&song=your%20song&url=some_url_goes_here_but_hardly_any_clients_use_it
In case that is difficult to read, these are the parameters:
You'll note that these same parameters, and others, can all be found in the SHOUTcast admin panel.
I developed shoutcast wrapper native C files along with a sample android app that you can stream from device microphone -> android-icecast-broadcast.
It is captures, encodes pcm audio from mic. and broadcasts ice server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With