I'm currently working on a app for a podcast (katg.com) which will let you listen live etc... however, I have not found any open source code available to stream shoutcast. I know there are some ways of doing it, but I find it hard to find any available code on the net that explains it for a java/android beginner like myself.
Anyone know of any libs/tutorial/examples/code that shows how to do this on android?
As Erich seems to have accidentally posted the wrong link, here's another resource about the protocol: http://forums.radiotoolbox.com/viewtopic.php?t=74
The shoutcast stream itself is accessible via HTTP. For example via Telnet:
$ telnet myshoutcastserver.com 8000
GET / HTTP 1.1
..............a lot of streaming stuff........
So you could try to buffer the stream data and when there is enough to play pass it to a MediaPlayer instance.
There is a shoutcast streaming application for android on github: http://github.com/Dawnthorn/nagare/
I didn't try it and it seems to be not continued. However maybe the code helps :)
Here's some text on how the Shoutcast protocol works: SHOUTcast Protocol. It's not as good as sample code, but it might come in useful.
Edit: Fixed the link.
In case you haven't found it by now, Icecast is an open source audio streaming server that supports the SHOUTcast protocol: http://www.icecast.org/index.php
来源:https://stackoverflow.com/questions/1932620/shoutcast-streaming