문제

What is the difference between the Play and Resume methods in the XNA SoundEffects class? Both seem to start playing the sound at the current sound position. Can't I basically always use Play()?

I am using XNA 4 (with the latest updates).

도움이 되었습니까?

해결책

The difference is simple:

  • Play starts the execution of a SoundEffect from the beginning of the audio file
  • Resume is the dual of Pause, and let you resume a SoundEffect from the moment you called Pause

UPDATE

If you're using SoundEffectInstance here's the answer to your question.

Play method plays or resumes a SoundEffectInstance

So the difference is that you can do both things only using Play, Resume of course can't be called if the sound effect is not paused.

다른 팁

First, what version of XNA are you using? And second, I believe Play and Resume are SoundEffectInstance class methods and the difference is that you can't START a sound effect (that has never been started) by using Resume.

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