Jump to content


alcSuspendContext is not working


1 reply to this topic

#1 janellesnow

    New Member

  • Members
  • Pip
  • 5 posts

Posted 21 March 2009 - 03:58 PM

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...als/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

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 5311 posts
  • LocationSanta Clara, CA

Posted 21 March 2009 - 05:09 PM

Please use [code]...[/code] tags when you post code on the forum. Thanks!
reedbeta.com - developer blog, OpenGL demos, and other projects





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users