问题描述
我在开发Windows Phone应用程序是新的,很抱歉,如果我做了一些愚蠢的错误。结果
我不能在WP 8打Shoutcast的,我已经尝试过别人什么线程的建议,但它并不能帮助。
下面是我的代码部分:(尽管它可能会起到不Shoutcast的一个)
私有静态列表< AudioTrack> _playList =新的List< AudioTrack>
{
新AudioTrack(新的URI(http://198.50.156.4:8062/;UriKind.RelativeOrAbsolute),广播视野,NULL,NULL,NULL,NULL,EnabledPlayerControls.All ),
新AudioTrack(新的URI(http://live.radiocosmobandung.com.:8001/cosmo,UriKind.RelativeOrAbsolute),与Ardan科斯莫,NULL,NULL,NULL,NULL,EnabledPlayerControls.All ),
};
你已经解决问题了吗?我发现在这个项目的解决方案
您不能把Shoutcast的链接在AudioPlayer类您的播放列表,所以你需要设置播放列表是这样的:
私有静态列表< AudioTrack> _playList =新的List< AudioTrack>
{
新AudioTrack(NULL,电台名称,音乐名称,NULL,NULL),
};
和之后,你需要去对AudioStreamer类OnBeginStreaming方法,并将这样的方法:
保护覆盖无效OnBeginStreaming(AudioTrack轨道,AudioStreamer流光)
{
//设置ShoutcastMediaStreamSource流Shoutcast的这里电台
ShoutcastMediaStreamSource源=新ShoutcastMediaStreamSource(新的URI(http://108.170.51.210:8068/;UriKind.RelativeOrAbsolute));
//设置源
streamer.SetSource(源);
}
您将设置ShoutcastMediaStreamSource做Shoutcast的链接流。
哦,还有一件事(实际上三级)。你需要在AudioStreamAgent的参考文献的Silverlight.Media.Phone和SM.Media,最后一个是把用
Silverlight.Media;
在AudioStreamer.cs的头。
和我的英语水平错误抱歉。 (:
I'm new in developing Windows Phone app, so sorry if I do some silly mistakes.
I can't play shoutcast on WP 8, I already tried what suggested on someone else thread, but it doesn't help.
Here's part of my code: (though it could play no shoutcast one)
private static List<AudioTrack> _playList = new List<AudioTrack>
{
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),
};
have you already fixed your problem? I've found the solution in this project
You can't put the Shoutcast link in your playList on AudioPlayer class, so you need to set the playList like this:
private static List<AudioTrack> _playList = new List<AudioTrack>
{
new AudioTrack(null, "Radio Name", "Music Name", null, null),
};
and after you need to go on OnBeginStreaming method in AudioStreamer class and set the method like this:
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);
}
you'll set the ShoutcastMediaStreamSource to do the stream of a Shoutcast link.
Oh, and one more thing (actually three). You'll need the Silverlight.Media.Phone and SM.Media in References of AudioStreamAgent, and the last one is put
using Silverlight.Media;
on the header of AudioStreamer.cs.
And sorry for my english errors. (:
这篇关于无法与端口backgroundAudio在Windows Phone 8打Shoutcast的IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!