Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
基本上,我想获得 XNA 4.0 中给定的 SoundEffects 实例的状态。有没有办法知道声音当前是在播放还是停止?
是的,这是可能的,但您需要使用SoundEffectInstance. 您可以使用SoundEffect.CreateInstance 方法创建它。请记住SoundEffectInstance,最初创建为已停止。
SoundEffectInstance
SoundEffect.CreateInstance
该类具有SoundEffectInstance.State允许您获取声音效果的当前状态的属性:播放、暂停或停止。 参考MSDN。
SoundEffectInstance.State