I have the need to play multiple soundeffects at once in my WP7 app. I currently have it working with wav files that takes around 5 megabyte, instead of 500kb when coded in wma/mp3.
Current part of the code:
Stream stream = TitleContainer.OpenStream(String.Format("/location/{0}.wav", value)
SoundEffect effect = SoundEffect.FromStream(stream);
effect.Play();
This works great in a loop, preparing all effects, and then playing them.
However, I would really like to use mp3/wma/whatever-codec to slim my xap file down.
I tried to use MediaElement
, but it appears that you also can't use that to play multiple files. Also the XNA MediaPlayer
can't be instantiated, and as far as I experienced can't be made to play multiple files at once.
The only solution I see left is that I somehow decode the mp3
to wav
and feed that Stream
to SoundEffect
.
Any ideas on how to accomplish the multiple playback? Or suggestions on how to decode mp3
to wav
?