在Windows Phone 8上无法使用带有backgroundAudio的端口播放shoutcast ip

我是开发Windows Phone应用程序的新手,如果我犯了一些愚蠢的错误,那就很抱歉。
我不能在WP 8上播放shoutcast,我已经尝试过在别人的post上提出的建议,但它没有帮助。

这是我的代码的一部分:(虽然它可以不播放shoutcast)

private static List _playList = new List { new AudioTrack(new Uri("http://198.50.156.4:8062/;",UriKind.RelativeOrAbsolute), "Radio Vision", null, null, null, null , EnabledPlayerControls.All), new AudioTrack(new Uri("http://live.radiocosmobandung.com.:8001/cosmo", UriKind.RelativeOrAbsolute), "Ardan Cosmo", null, null, null, null , EnabledPlayerControls.All), }; 

你已经解决了问题吗? 我在这个项目中找到了解决方案

你不能把Shoutcast链接放在AudioPlayer类的playList中,所以你需要像这样设置playList:

 private static List _playList = new List { new AudioTrack(null, "Radio Name", "Music Name", null, null), }; 

并且在需要在AudioStreamer类中继续OnBeginStreaming方法并设置如下方法之后:

 protected override void OnBeginStreaming(AudioTrack track, AudioStreamer streamer) { // Set the ShoutcastMediaStreamSource to stream shoutcast radio here ShoutcastMediaStreamSource source = new ShoutcastMediaStreamSource(new Uri("http://108.170.51.210:8068/;", UriKind.RelativeOrAbsolute)); // Set the source streamer.SetSource(source); } 

你将设置ShoutcastMediaStreamSource来做一个Shoutcast链接的流。

哦,还有一件事(实际上是三件)。 你需要AudioStreamAgent参考资料中的Silverlight.Media.Phone和SM.Media,最后一个是放的

 using Silverlight.Media; 

在AudioStreamer.cs的标题上。

抱歉我的英语错误。 (:

Shoutcast不支持开箱即用,您需要自己实现阅读此类流。 不容易。