• Advertisement

Archived

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

playing partial sounds

This topic is 5902 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
Advertisement
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.

Cheers,
John

Share this post


Link to post
Share on other sites

  • Advertisement