Search code examples
audio-streamingshoutcastinternet-radio

Value type of icy-metaint


Researching this issue I can not find first-hand description of this variable in the standard. I actually can not find proper description of ICY standard at all.

Seems some programmers think that this value must be signed integer (e.g. here). However another example says that this value can be 32768 which is outside of signed integer definition.

I understand that "signed integer" in different circumstances may mean 2 byte size or 4 byte size. So what is the size of the value in bits (including sign if it is signed)? I need to know it because I code Verilog and do not want to spend logic for unneeded bits.

P.S. "metaint" should mean meta information interval, int in this word must not mean integer type!


Solution

  • icy-metaint is the number of bytes of media stream data between each metadata chunk.

    Suppose I have an internet radio station, with icy-metaint value of 8192. The data from the server will look something like this:

    [8192 bytes audio] [metadata] [8192 bytes audio] [metadata] …
    

    The size of this interval of this is up to the server and its configuration. You should be able to handle a wide range of values. Realistically, a 32-bit unsigned integer should be sufficient.

    I have personally seen metadata intervals as high as 64KB. I wouldn't be surprised to see them higher in oddball situations. 8KB and 16KB are very common. Also note that it's not necessary to have normal values like this... I've also seen things like 15,000 bytes.