I'm creating a mini game. It has music background and gun sound. But I can not play them at the same time. How can I do it ???

有帮助吗?

解决方案

You can't - as MSDN says:

When a MediaElement control plays audio or video content, any background sounds or media already playing are halted. The app launches the playback experience when the user taps the control. Only one MediaElement control can operate at a time.

Instead you can try to use SoundEffect from XNA to play your gun sound.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top