简体   繁体   中英

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. The problem is that when I pass the radio station's URL using this method:

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"

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.

The URL you provided in your question returns the following playlist:

[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. You might try with another, known-good URL.

As far as parsing a PLS file, the general format is described here . It seems that a .PLS file is just an INI file with certain values in it by convention. Using Google, I found this INI parser written in Objective-C . There are probably others as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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