Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Quick question:

I have a SoundEffect instance, and I would like to know if it is playing at the moment or not. But there's neither a method, nor a property that would allow to check it...

So, is there a way to know it?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Found the answer myself :)

Apparently you have to do this:

SoundEffectInstance qwe = yourSound.CreateInstance();
qwe.State ...

And that state will contain... well, the state of the sound. Also SoundEffectInstance countains bunch of other useful data.

share|improve this answer
    
Yes, you have to create instances, this way you have more control of your sounds. And also, can you accept your own answer? For marking it as answered. –  Gustavo Maciel Sep 27 '12 at 0:44
    
@GustavoMaciel done :) –  NewProger Oct 7 '12 at 8:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.