I am trying to play a sound in a new thread, so that other sounds don't interrupt it, while it is playing.
But it doesn't work. Although the new thread runs in background (I assume), the sounds which are played afterwards interrupt it.
ParameterizedThreadStart pts;
Thread t;
private void playStreak(Object p)
{
SoundEffect sound = SoundEffect.FromStream(Application.GetResourceStream(new Uri("SOUNDFX/BOMB.wav", UriKind.Relative)).Stream);
SoundEffectInstance instance = sound.CreateInstance();
instance.Play();
}
private void playAsThread()
{
pts = new ParameterizedThreadStart(playStreak);
t = new Thread(pts);
t.Name = "Streak sound!";
t.Start();
}
I want to play various sounds without interrupting each other.