• Advertisement

Archived

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

Pausing Sounds in DirectX Audio

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

Hi, I''ve written a wrapper class for DirectX audio, so I can do basic things like play a sound, or stop a sound... But does anyone know how to Pause a sound??? I''ve been looking everywhere for some idea on how to do this and I can''t seem to figure it out. I think maybe it has to do with some buffer manipulation, or maybe you have to store some variable for each segment that says "what position in the sound file is being played" so that you can resume playing from that position... If anyone has an idea on how to do this, I''d *really* appreciate it. Thanks! Rajan

Share this post


Link to post
Share on other sites
Advertisement
Hi Rajan,

This is what I do (it may give you a hint):

MUSIC_TIME musicTimeStopped;
m_pPerformance->GetTime(NULL, &musicTimeStopped);
m_pSegment->SetStartPoint(musicTimeStopped);
m_pPerformance->Stop(NULL, NULL, 0, 0);

Then when you play again the segment, it''ll start from where it was stopped.

I use it to pause the whole thing, but it may work to pause for a specific sound.

Hope it helps,

--
Jose Manuel Guerra
jmguerra@guerragames.com
GuerraGames

Share this post


Link to post
Share on other sites

  • Advertisement