如何在 WP7 上播放来自 Icecast 的音频流

发布于 2024-10-11 15:38:58 字数 246 浏览 5 评论 0原文

如何在 WP7 上播放来自 Icecast 的音频流

我尝试过 SMF、SmoothStreaming Client 和 MediaElement。

这些都不起作用。格式为 asx 或 wma。

编辑:

最近我发现了一个新的流。当我在设计师中时,此流有效。但它在设备上不起作用。在设备上,流会立即打开和关闭。

该流来自 IceCast 服务器,采用 MP3 格式。带有 ?.mp3 扩展名。或没有。

How can I playback an audio stream from a Icecast on WP7

I have tried SMF, SmoothStreaming Client and the MediaElement.

None of these have worked. The formats are either asx or and wma.

Edit:

Recently I found a new stream. this stream works when I'm in the designer. But it does not work on the device. On the device the stream is opened and closed immediately.

this stream is from an IceCast server in MP3 format. with a ?.mp3 extention. or without.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

尛丟丟 2024-10-18 15:38:58

当您进行直播广播时,该流可能由 IceCast 服务器或 ShoutCast 服务器进行编码。要读取这些流,您需要对内存中的流进行解码,并在解码后将其传递给 MediaElement。

查看 Mp3MediaStreamSource

Silverlight 的音频输出

我在这方面浪费了大量时间,这是我迄今为止找到的最佳解决方案。

When you are streaming live radio, the stream may be encoded by an IceCast server or ShoutCast server. To read these streams, you will need to decode the stream in memomry and pass it to the MediaElement once it has been decoded.

have a look at Mp3MediaStreamSource

and Audio output from Silverlight

I lost tons of time on this, and this is the best solution I found so far.

江心雾 2024-10-18 15:38:58

快速浏览了 Icecast 网站(我不熟悉他们的服务),似乎他们提供的流媒体音频大部分内容都是以 MP3 格式提供的,但他们以 M3U 或 XSPF 格式提供播放列表。您无法将其提供给 WP7 框架中的任何内置控件或类,但您可以解析文件的内容并将其传递给 MediaElement 以播放单个文件。

M3U 文件是组成 URL 的简单列表,因此处理起来最简单,但 XSPF 格式(一种 XML 格式)提供了更多信息,例如标题。您可以轻松地使用 XDocument 类来解析 XSPF 文件,然后使用 LINQ 来查询内容。

Having had a quick look at the Icecast web site (I'm not familiar with their service) it seems that most of what they offer for streamed audio is offered in MP3 format, but that they provide this as playlists in either M3U or XSPF format. You can't provide this to any of the built-in controls or classes in the WP7 framework, but you can parse the contents of the file and pass that to a MediaElement to play individual files.

The M3U file is a simple list of the consituent URLs, so is the simplest to deal with, but the XSPF format (which is an XML format) provides more information, such as the title. You can easily use the XDocument class to parse the XSPF file and then use LINQ to query the contents.

御弟哥哥 2024-10-18 15:38:58

您没有将 ?.mp3 添加到 pls 文件中的嵌入 URL 中吗?如果您使用从 PLS/M3U 文件获取的 URL,则可能需要为其附加文件扩展名。您通常可以通过在 URL 中添加 ?ext=.mp3 或 ?file.mp3 来实现此目的,并且它应该可以与 MediaElement 一起播放,正如我在 MS 开发板上读到的那样,人们已经将其与 Shoutcast 流一起使用。

You're not adding the ?.mp3 to the pls file right, to the embedded URL? IF you are using the URL you get from the PLS/M3U file, you might need to append a file extension to it. You can often do this by adding ?ext=.mp3 or ?file.mp3 to the URL and it should play with MediaElement, as I read on the MS dev boards that people had been getting that to work with Shoutcast streams.

养猫人 2024-10-18 15:38:58

当您从计算机上拔下设备时,您的流媒体是否可以在设备上运行?当您插入 Zune 同步中心时,无法播放媒体。

克里斯

Does your stream work on the device when you unplug it from the computer? Media playing doesn't work while you're plugged into the Zune sync center.

Chris

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文