The following is the code that needs to be changed/added in order for the new version of ALUT to be used with OALWrapper. This is confirmed to work with ALUT 1.1.0.
In OAL_WAVSample.cpp line 54:
#if defined(__APPLE__)
alutLoadWAVFile ( (ALbyte*) sFilename.c_str(), &mFormat, &pPCMBuffer, &lSize, &mlFrequency);
#else
alutLoadWAVFile ( (ALbyte*) sFilename.c_str(), &mFormat, &pPCMBuffer, &lSize, &mlFrequency, AL_FALSE);
#endif
Changes to:
#if defined(__APPLE__)
pPCMBuffer = alutLoadMemoryFromFile(sFilename.c_str(), &mFormat, &lSize, &mlFrequency);
#else
pPCMBuffer = alutLoadMemoryFromFile(sFilename.c_str(), &mFormat, &lSize, &mlFrequency);
#endif
In order for alutLoadMemoryFromFile to work in the new API, ALUT must be initialized first. Therefore some code must be added to OAL_Device.cpp.
At the end of cOAL_Device::Init:
#ifdef WITH_ALUT
if(!alutInitWithoutContext(NULL,NULL))
{
LogMsg("",eOAL_LogVerbose_None, eOAL_LogMsg_Error, "Error initializing ALUT\n");
return false;
}
#endif
And just before the end in cOAL_Device::Close:
#ifdef WITH_ALUT
LogMsg("",eOAL_LogVerbose_Low, eOAL_LogMsg_Info, "Exiting ALUT...\n" );
if(!alutExit())
{
LogMsg("",eOAL_LogVerbose_None, eOAL_LogMsg_Error, "Error exiting ALUT!\n");
}
#endif