WP7 同时/动态播放许多压缩(mp3、wma 等)音频文件 [英] WP7 play many compressed (mp3, wma etc) audio files simultaneously/dynamically

查看:24
本文介绍了WP7 同时/动态播放许多压缩(mp3、wma 等)音频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于尺寸原因,我需要将 WP7 应用程序与压缩音频(mp3、wma 等)捆绑在一起.我如何自由/同时播放这些?

For size reasons I need to bundle a WP7 app with compressed audio (mp3, wma etc). How do I play these freely/simultaneously?

XNA 框架只支持 WAV 文件,所以除非在某处有一个纯 C# 托管代码库来即时解压 mp3/wma/ogg (?),否则下一个选项是...

The XNA framework only supports WAV files, so unless there is a pure C# managed code library somewhere to decompress mp3/wma/ogg (?) on the fly, the next option would be...

媒体元素.但是我用 MediaElement 没有得到好的结果.好像需要专门在xaml中添加一个MediaElement作为标签,不能同时使用多个实例(几个标签).一旦我播放了某个 MediaElement,我就无法在同一页面上播放另一个 MediaElement.我在参考文献中没有找到任何关于限制的信息(参考文献非常空).我也尝试动态创建 MediaElement 对象,但这似乎根本无效,或者我根本无法让它播放文件.

MediaElement. But I don't get good results with MediaElement. It seems that you need to add a MediaElement specifically as a tag in the xaml, and you can't use several instances (several tags). As soon as I play a certain MediaElement I can't play another MediaElement on the same page. I don't find anything about a restriction in the reference (the reference is very empty). I also tried dynamically creating MediaElement objects, but that doesn't seem valid at all, or I just cannot get it to play the files at all.

推荐答案

根据我的经验,目前在 WP7 上没有很好的解决方案.要么将 wavs 与 XNA 一起使用并增加 xap 的大小,要么使用具有非常有限的 MediaElement 功能的 mp3,从而影响您可以使用它实现的功能.

In my experience currently there's no good solution for this on WP7. Either you use wavs with XNA and grow the size of the xap or use mp3s with the very limited MediaElement functionalty, compromising on what you can implement with it.

可能能够将一些C# 音频库移植到 WP7,到目前为止我还没有听说过,所以它可能是远射.

You might be able to port some C# audio libraries to WP7, I haven't heard of any so far so it might be long shot.

在我的一个应用程序中,在尝试了一段时间的不同选项后,我最终决定使用 wav + XNA 组合.

In one of my apps I finally decided to go with the wav + XNA combination after playing around with different options for a good while.

这篇关于WP7 同时/动态播放许多压缩(mp3、wma 等)音频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆