我试图在新线程中播放声音,以便在播放时其他声音不会中断它。线程不在后台运行
但它不起作用。虽然新线程在后台运行(我假设),但后来播放的声音会中断它。
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();
}
我想在不中断对方的情况下播放各种声音。
你读过这个问题吗? http://stackoverflow.com/questions/6240002/play-two-sounds-simultaneusly – Fabske
不适合silverlight – QKL