Title of current icecast streamed song

与世无争的帅哥 提交于 2019-12-02 05:34:15
Brad

The metadata for SHOUTcast/Icecast streams is not in the headers, but in the actual stream itself.

That icy-metaint: 16000 header you have is the key. Every 16,000 bytes, you will get a metadata block. The first byte in that block indicates metadata length. Multiply its value by 16 to get the length in bytes. Once you do that, you will end up with something like this:

StreamTitle='Awesome Trance Mix - DI.fm';StreamUrl=''

It will be padded at the end by null bytes until you reach the length of the block.

I have answered the same question here for PHP, but the concept is the same no matter what language: Pulling Track Info From an Audio Stream Using PHP

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!