简体   繁体   English

如何使用Matt Gallagher AudioStreamer在iPhone应用程序中流式传输SHOUTcast广播电台?

[英]How to stream SHOUTcast radio stations in iphone app using Matt Gallagher AudioStreamer?

I have implemented Matt Galagher's AudioStreamer class to stream radio stations from ShoutCast. 我已经实现了Matt Galagher的AudioStreamer类,以从ShoutCast流式传输广播电台。 The problem is that when I pass the radio station's URL using this method: 问题是,当我使用此方法传递广播电台的URL时:

NSURL *streamingURL = [NSURL URLWithString:http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280356];
streamer = [[AudioStreamer alloc] initWithURL:streamingURL];

I get the streaming extension type = .pls which Matt Galagher's AudioStreamer Class fails to play and I get the following error: "Unable to configure network read stream" 我收到流扩展名类型= .pls,Matt Galagher的AudioStreamer类无法播放,并且出现以下错误:“无法配置网络读取流”

Please tell any method to stream .pls file extension or provide any other class which could parse and stream the stations with .pls file extension format. 请告诉任何流.pls文件扩展名的方法,或提供任何其他类可以解析并以.pls文件扩展名格式流化工作站的类。

The URL you provided in your question returns the following playlist: 您在问题中提供的URL返回以下播放列表:

[playlist]
numberofentries=0
Version=2

I'm not familiar with AudioStreamer, but even if it can read .pls files, there's nothing in that one to play, so I would expect it to fail. 我对AudioStreamer并不熟悉,但是即使它可以读取.pls文件,也无法播放该文件,因此我希望它会失败。 You might try with another, known-good URL. 您可以尝试使用另一个已知良好的URL。

As far as parsing a PLS file, the general format is described here . 至于解析PLS文件, 此处描述了通用格式。 It seems that a .PLS file is just an INI file with certain values in it by convention. 似乎.PLS文件只是按照惯例包含某些值的INI文件。 Using Google, I found this INI parser written in Objective-C . 使用Google,我发现了这个用Objective-C编写的INI解析器 There are probably others as well. 可能还有其他。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM