3

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!

Brad
  • 159,648
  • 54
  • 349
  • 530
Anonymous
  • 561
  • 3
  • 7
  • 24

1 Answers1

5

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.

Brad
  • 159,648
  • 54
  • 349
  • 530
  • Thank you. Did you ever see any documented specification for this value? I though there *have to be* ICY protocol specification somewhere! – Anonymous Nov 21 '17 at 08:20
  • 1
    @Anonymous Actually, there doesn't. SHOUTcast is closed source, no spec. Icecast developers will tell you to look at their source code. I tell people to look at my Stack Overflow answer here: https://stackoverflow.com/questions/4911062/pulling-track-info-from-an-audio-stream-using-php/4914538#4914538 For your purposes, even if you had a perfectly written IETF specification, it's irrelevant. Reality is that you need to store more than a 16-bit integer, and that no properly configured stream is going to use more than 32 bits for its metadata interval. Therefore, you should use a 32-bit int. – Brad Nov 21 '17 at 15:06