使用MediaElement一次播放多个声音 [英] Playing more than one sound at once with MediaElement

查看:168
本文介绍了使用MediaElement一次播放多个声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用多个MediaElement一次播放多个声音?我正在将钢琴风格的应用程序从Win8移植到WinPhone7/8,并发现了一些意外的问题.我还发现按下按钮播放后的延迟非常高 与使用MediaElement的Win8相比声音.

Is it possible to play more than one sound at once using multiple MediaElements ?  I'm porting a piano style app from Win8 to WinPhone7/8 and finding a few unexpected issues. I've also found that latency is very high after pressing a button to playing the sound compared to Win8 using MediaElement.

是否有推荐的方法来解决我所缺少的问题?

Is there a recommended way to approach this that I'm missing?

谢谢.

推荐答案

Google终于参加了这个聚会.似乎答案是"Xna".

Google finally came to the party on this one. Seems like the answer is "Xna".

万一其他人对我一无所知...

In case anyone else knows as little as me...

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;

Stream stream = TitleContainer.OpenStream("sounds/ping.wav");
SoundEffect effect = SoundEffect.FromStream(stream);
FrameworkDispatcher.Update();
effect.Play();


这篇关于使用MediaElement一次播放多个声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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