문제

Basically, I want to obtain the state of a given instance of SoundEffects in XNA 4.0. Is there a way to know whether a sound is currently playing or stopped?

도움이 되었습니까?

해결책

Yes, it's possible, but you need to use SoundEffectInstance. You can create it using SoundEffect.CreateInstance method. Remember that the SoundEffectInstance is created as stopped, initially.

That class has the SoundEffectInstance.State property that allows you to get the current state of the sound effect: playing, paused, or stopped.
Reference MSDN.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top