Sign in to follow this  
bballmitch

Pause and then resume in OpenAL

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this