Skip to content
Markku Post-Uttula edited this page Dec 30, 2021 · 1 revision

FAQ

I want to build my own metadata listener ... can I do that?

You most certainly can! In fact, it isn't even too difficult :)

For "broadcasting", Traktor uses IceCast -protocol, which is little more than a glorified extension of Your basic HTTP -server.

In HTTP, discussion between client (browser) and server goes not entirely unlike this:

  • Client contacts Server
  • Client requests "something" from Server
    • e.g. "GET /something.html" + other headers + an extra newline to signify "I'm done talking"
  • Server responds to the request
  • Server disconnects the connection because "we're done here"

In IceCast, discussion between client (Traktor) and server goes somewhat like this:

  • Client contacts Server
  • Client requests a stream connection from the Server
    • e.g. "STREAM /assigned-endpoint" + other headers + an extra newline signifying "I've told you basic details"
  • Server continues to listen for more data
  • Client continues to send "more data"

So... what does this "more data" contain?

With IceCast, it can be pretty much anything; a stream of Ogg/Vorbis, a stream of MP3 (the main difference between IceCast and ShoutCast used to be that ShoutCast originally only supported MP3-streams, whereas IceCast preferred Ogg/Vorbis) or ... pretty much anything you could "stream" ... heck, with IceCast, it is by design possible to stream video using the same protocol.

In order to create Your own "metadata listener", You need to not only be able to handle the transfer protocol, but also parse the data protocol.

Both IceCast and ShoutCast -servers are more than trivial to implement in a stream-agnostic manner when You're familiar with the basic HTTP; once that has been done, it is all up to reading and perusing the incoming stream data in a cost-efficient way. Of course, this means that You need to first determine the type of incoming stream - if You don't, You're forced to brute-forcing things ... which is never a good idea IMHO.

Further Details?