How to use Shoutcast in iphone application?

I only know that the ShoutCast function allows you to stream a list of radio stations.

But not knowing how to use this in an iphone application.

Now I just look at his website http://www.shoutcast.com/ becaues I have not found a lot of all this from googling execpt for my website

Any tutorials would be helpful.

I get an answer like,

<?xml version="1.0" encoding="UTF-8"?> <stationlist> <tunein base="/sbin/tunein-station.pls" /> <station name="PJ Nicky SuperRequest - a SHOUTcast.com member station" mt="audio/mpeg" id="172748" br="64" genre="Various" ct="(Ost. ) -" lc="9946" /> <station name=" TOP 100 ReaLCasT - a SHOUTcast.com member station" mt="audio/mpeg" id="242423" br="128" genre="" ct="- Be My Baby" lc="7485" /> <station name="Alex Jones - Infowars.com - a SHOUTcast.com member station" mt="audio/mpeg" id="1026951" br="32" genre="Talk News Political" ct="Sunday Show Replay - Hr 2 (PrisonPlanet.tv)" lc="4216" /> <station name=" . - a SHOUTcast.com member station" mt="audio/mpeg" id="119368" br="128" genre="" ct="[db]" lc="3453" /> <station name="Auto PJ. RequestRadio - a SHOUTcast.com member station" mt="audio/mpeg" id="30375" br="128" genre="" ct="- The Star 7" lc="2453" /> </stationlist> 

Successfully analyze this and get /sbin/tunein-station.pls

Now how do i get

 NSString *data = [[NSString alloc]initWithContentsOfURL:[NSURL URLWithString:"http://yp.shoutcast.com/sbin/tunein-station.pls?id=21585&play_status=1"]]; 

since I only get /sbin/tunein-station.pls

 NSString *strEscapedValue = (__bridge_transfer NSString * )CFURLCreateStringByAddingPercentEscapes(nil, (__bridge CFStringRef)data, NULL, NULL, kCFStringEncodingUTF8); NSLog(@"escaped value : %@",strEscapedValue); 

strEscapedValue gives (null)

 NSURL *url = [NSURL URLWithString:strEscapedValue]; streamer = [[AudioStreamer alloc] initWithURL:url]; 
+4
source share
2 answers

I'm not quite sure if this will help, but here is the solution I came up with. You can use mattgallagher audio streamer to help you stream music from a url. now, in order to get the β€œstreaming” url, you have to parse it from the pls, like this one that I grabbed from the shoutcast site. You can get aac url from pls file by simply opening it as text. for iPhone you can go something like this

  NSString *data = [[NSString alloc]initWithContentsOfURL:[NSURL URLWithString:"http://yp.shoutcast.com/sbin/tunein-station.pls?id=21585&play_status=1"]]; 

Please note that the URL of the pls file that will receive all the text in the pls file. now you can just parse acc url and use in the audio stream

+1
source

I just found a way to have a Shoutcast Stream Player on your iPhone. In HTML 5. Look here, it works! http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-the-html-5-audio-element/

0
source

Source: https://habr.com/ru/post/1389786/


All Articles