当`SoundEffectInstance.Stop()`时,Windows Phone发出噼啪声

时间:2012-12-04 11:31:47

标签: c# .net windows-phone-7 audio xna

我的SoundEffectInstance很少。当我停下来时会发出咔哒声(我需要尽可能快地完成)。我在某处嘲笑它的“声音效果”是通过削减声波来实现的。我试着写点像

ThreadPool.QueueUserWorkItem(delegate        {
        for (float i = 1f; i > 0.01; i /= 2f)
        {
            foreach (var sound in Sounds.Values)
            {
                if (sound != null && !sound.IsDisposed)
                {
                    sound.Volume = i;
                }
            }
            Thread.SpinWait(500); //Tried different dellays here
        }
    });
    Sounds.Clear();  

但它确实没有帮助。我该怎么做才能避免快速停止声音?

0 个答案:

没有答案
相关问题