Alex Rivera | Logout

Play two sounds simultaneusly

Asked 2011-06-04T23:27:40.997
31

Is there a way to play two sounds at the same time?

I know that SoundPlayer isn't able to do this. I can't use SoundEffect as I believe it's only part of XNA.

The two required sounds will be called at unknown and random times. The sound needs to be be controlled after it is played. i.e., the sound must be able to be stopped before it has finished playing.

Edit
Report

1 Answer

0

Solution : Hi, I was developing a WP8 App and i needed multiple sounds to play simultaneously, the solutions mentioned above didnt work for me, So i used the XNA framwork. here is the link

http://msdn.microsoft.com/en-us/library/ff842408.aspx

and then play ur sound files like this...

SoundEffect Sound = SoundEffect.FromStream(Application.GetResourceStream(new Uri("Assets/Sounds/wav/sound.wav", UriKind.Relative)).Stream);
Sound.Play();

For looping...

SoundEffectInstance Sound = SoundEffect.FromStream(Application.GetResourceStream(new Uri("Assets/Sounds/wav/sound.wav", UriKind.Relative)).Stream).CreateInstance();
Sound.IsLooped = true;
Sound.Play();

Note: the files must be in ".wav" (PCM, 8 or 16-bit, 8KHz to 48KHz, mono or stereo) format

answered 2013-02-15T06:49:13.863

Your Answer