Developing the client for the icecast server

断了今生、忘了曾经 提交于 2019-11-28 19:51:47
Brad

For your purposes, Icecast and SHOUTcast are equivalent.

They both use a bastardized version of HTTP. In fact, you can make a simple HTTP request and use standard HTTP client libraries, and it will almost always work just fine. The only thing different is that SHOUTcast will return ICY 200 OK instead of HTTP 200 OK in its response.

Now if you make the request, as you have done above, you get a standard audio stream that you can play directly. As you have pointed out, MP3 and AAC are used almost exclusively, but other formats can be used.

If you want metadata, you have to tell the server you are prepared to receive it. You have to put this header in your request:

Icy-MetaData:1

Once you do that, you will see another header come back to you in the response, such as icy-metaint:8192, which means that every 8192 bytes, you will receive a chunk of metadata.

I won't go into further details because this is already well documented. No need to re-type the wheel:

Pulling Track Info From an Audio Stream Using PHP

http://www.smackfu.com/stuff/programming/shoutcast.html

However, if you do have questions as you go, please post them on StackOverflow and tag them as icecast or shoutcast, and I will be happy to assist you.

Juan David Decano

I have just recently finished a project for radio station, where they used icecast. I want to share you the radio player and some PHP Wrappers that i have used to get information from centova,icecast and lastfm.

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