Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


playing partial sounds

This topic is 6178 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

I want to be able to play a piece of a dsound buffer, either starting play somewhere after the beginning, stopping play somewhere before the end, or both. I can do this using get/setposition() in combination with play() and stop(), or, it seems, I can do this using the direct sound notifications interface in combination with createevent(). I''m wondering what are the pros and cons of each approach, and are there other approaches. thanks.

Share this post

Link to post
Share on other sites
You will have to use SetPosition to set the start position of the sound. Notifications won''t really help you there. However, when checking for the end either method is fine.

If you are using GetPosition then you must accept that you are calling it yourself every frame, and as such you may be a few milliseconds out. Failing that you could call GetPosition from within a thread, which is basically how Notifications work anyway.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!