alcSuspendContext is not working

961d9ba693d96f854ff984688179c886
0
janellesnow 101 Mar 21, 2009 at 15:58

Hi,

I am trying to halt and resume the sounds from OpenALSystem. But i discovered that alcSuspendContext does not work for me according to the tutorial.

http://www.devmaster.net/articles/openal-tutorials/lesson4.php

Belows are my 2 functions, hope anyone has any idea why it is not working. Is there something else that I missed out?

        void HaltAudioSystem() 
        { 
                cout << "HaltAudioSystem" << endl; 

                ALCcontext* pCurContext; 
                ALCdevice* pCurDevice; 

                // Get the current context. 
                pCurContext = alcGetCurrentContext(); 

                // Get the device used by that context. 
                pCurDevice = alcGetContextsDevice(pCurContext); 

                // set the current context to NULL will 'shutdown' openAL 
                alcMakeContextCurrent(NULL); 

                // now suspend your context to 'pause' your sound world 
                alcSuspendContext(pCurContext); 

        } 


        void ResumeAudioSystem() 
        { 
                cout << "ResumeAudioSystem " << endl; 
                // Get Current Context 
                ALCcontext* alcContext = alcGetCurrentContext(); 
                // Restore open al context 
                alcMakeContextCurrent(alcContext); 
                // 'unpause' my context 
                alcProcessContext(alcContext); 
        } 

Thanks in advance

1 Reply

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Mar 21, 2009 at 17:09

Please use …[/code[b][/b]] tags when you post code on the forum. Thanks! [code]…[/code**] tags when you post code on the forum. Thanks!