我只知道 ShoutCast 的功能,它流式传输广播列表。
但不知道如何在 iphone 应用程序中使用它。
现在我只是在看它的网站http://www.shoutcast.com/ 因为我没有通过谷歌搜索它的网站 execpt 找到很多东西
任何教程都会有所帮助。
我得到的回应是,
<?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>
成功解析这个并得到/sbin/tunein-station.pls
现在我怎么得到
NSString *data = [[NSString alloc]initWithContentsOfURL:[NSURL URLWithString:"http://yp.shoutcast.com/sbin/tunein-station.pls?id=21585&play_status=1"]];
因为我只是得到/sbin/tunein-station.pls
NSString *strEscapedValue = (__bridge_transfer NSString * )CFURLCreateStringByAddingPercentEscapes(nil, (__bridge CFStringRef)data, NULL, NULL, kCFStringEncodingUTF8);
NSLog(@"escaped value : %@",strEscapedValue);
strEscapedValue
给(null)
NSURL *url = [NSURL URLWithString:strEscapedValue];
streamer = [[AudioStreamer alloc] initWithURL:url];