Jump to content
  • Advertisement
Sign in to follow this  
bballmitch

Pause and then resume in OpenAL

This topic is 4347 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 have this code: alSourcePause(alSource); . . .//Do stuff . alSourcePlay(alSource); but I'm not getting the effect I want. I want to pause the source, and then when I do alSourcePlay() the source should resume. Instead, what is happening, is the source is starting over. Why is this happening and how should i fix it?

Share this post


Link to post
Share on other sites
Advertisement
According to the my understanding of the spec, that shouldn't happen. It says "alSourcePlay applied to a AL_PAUSED source will resume processing using the source state as preserved at the alSourcePause operation." (from this page of the 1.1 spec). The 1.0 spec says the same thing. What implementation/version are you using? What are you doing between the pause and the play (the "// Do stuff")? If I get a chance, I'll try a really simple example and let you know how it goes.

Share this post


Link to post
Share on other sites
Oh...i just figured out the problem. I should have put this line:

if( !playing )
alSourcePlay...

Sometimes, the keyboard would double tap so it would restart.

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.

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!