Jump to content
  • Advertisement
Sign in to follow this  
orpeus

[SlimDX] How to tell if an XAudio2 voice is started?

This topic is 2459 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What is the best way to tell whether a SlimDX.XAudio2.SourceVoice is currently started or stopped? I didn't see any members that obviously contained this information.

Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Unfortunately I don't think that Xaudio2 allows you to poll a voice for its playing state. It is possible that you can use the GetState call on a source voice to tell if there are any queued buffers, but that is not really the same thing. If you are using it to play a large buffer and you may be able to use the StreamEnd event, but I believe that this will only fire if you have set the EndOfStream flag on the AudioBuffer (and maybe if you call Discontinuity) .

Hope this helps.

Share this post


Link to post
Share on other sites
Thanks for the confirmation. Unfortunately, I am looping everything, so the queue count is always 1. I'll try to avoid requiring the information, and if I do need it, I'll get State.SamplesPlayed, sleep for a few milliseconds, and check again to see if it increased.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!