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

889 Views Asked by At

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.

1

There are 1 best solutions below

0
On BEST ANSWER

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.