java 喊话流媒体
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1932620/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Shoutcast streaming
提问by
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?
我目前正在为播客 (katg.com) 开发一个应用程序,它可以让你收听现场直播等......但是,我还没有找到任何可用于流式传输的开源代码。我知道有一些方法可以做到这一点,但我发现很难在网上找到任何可用的代码来为像我这样的 java/android 初学者解释它。
任何人都知道任何显示如何在 android 上执行此操作的库/教程/示例/代码?
采纳答案by pocmo
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
由于 Erich 似乎不小心发布了错误的链接,这里是有关该协议的另一个资源:http: //forums.radiotoolbox.com/viewtopic.php?t=74
The shoutcast stream itself is accessible via HTTP. For example via Telnet:
可以通过 HTTP 访问 Shoutcast 流本身。例如通过 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.
因此,您可以尝试缓冲流数据,并在有足够播放数据时将其传递给 MediaPlayer 实例。
回答by pocmo
There is a shoutcast streaming application for android on github: http://github.com/Dawnthorn/nagare/
github 上有一个适用于 android 的shoutcast 流应用程序:http://github.com/Dawnthorn/nagare/
I didn't try it and it seems to be not continued. However maybe the code helps :)
我没有尝试,似乎没有继续。但是,也许代码有帮助:)
回答by andebauchery
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
如果您现在还没有找到它,Icecast 是一个支持 SHOUTcast 协议的开源音频流服务器:http: //www.icecast.org/index.php
回答by Erich Douglass
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.
下面是关于 Shoutcast 协议如何工作的一些文字:SHOUTcast Protocol。它不如示例代码好,但它可能有用。
Edit: Fixed the link.
编辑:修复了链接。

