Jump to content
  • Advertisement


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


how make "pause " to work in DirectAudio?

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

first forgive me my english is poor, i am a Chinese. my question is: we can use IDirectMusicPerformance8:laySegment or IDirectMusicPerformance8::Stop or some other way for Playback control. but how can I pause a sound(like a long speech)?it mean it will stop play , and when it play again,it start from where it stop. IDirectSoundBuffer8::SetCurrentPosition seem can do this, but it doesn''t work if the IDirectSoundBuffer8 is obtained from an audiopath. thank you for someone that can help me.

Share this post

Link to post
Share on other sites

you have your DirectMusicSegment
you have your DirectMusicperformance

so now you can do this...

//now you have the time at which your music segment is at

DirectMusicperformance->Stop(DirectMusicSegment, NULL, 0,0);
//now you have stopped the segment so it goes back to the

//starting point so you can now do this

//next time the segment starts it will start from "mt".

you should also keep track of whether the segment is paused or not with a bool or something, so that when you want to play it.

if not paused
then play song from beginning
else play song from last point

"For us it''s a natural disaster....For him/she it''s a damn memory leak..."
[Triple Buffer]|[SCRIPTaGAME]|[My Old Site]

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!