1

I can't play more than one sound per page. I created 2 instances of MediaElement, and each one, I set to play, but it only play one! How can I solve this please?

ctacke
  • 66,480
  • 18
  • 94
  • 155
Fulano
  • 65
  • 4

2 Answers2

2

If you add a reference to Microsoft.Xna.Framework to you project, you can use SoundEffect.Play to play mulitple sounds at the same time.

Matt Lacey
  • 65,560
  • 11
  • 91
  • 143
  • has there been any change with this on Windows Phone 8 Matt? Recently asked this question http://stackoverflow.com/questions/13963626/best-way-to-play-two-audio-files-simultaneously-in-windows-phone-8 – James Mundy Dec 20 '12 at 00:47
0

Add a event handler for MediaEnded to your first MediaElement control. In that event handler, start playing the sound on the second MediaElement using mediaElement2.Play().

bkaid
  • 51,465
  • 22
  • 112
  • 128
indyfromoz
  • 4,045
  • 26
  • 24
  • Dude, MediaElement can't be used to play more than one sound per page. Check this - http://www.exhd.com/blog/post/Playing-more-than-one-MediaElement-using-Windows-Phone-7-and-Silverlight.aspx if you find it useful. – indyfromoz Nov 12 '10 at 20:28
  • that link is broken. What do you mean "MediaElement can't be used to play more than one sound per page?" – Nick Heiner Jan 06 '11 at 15:58