0
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);

alcSuspendContext(pCurContext);

}

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