Question

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).

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top