Hi,
I want to use OpenAL plugin because I don't like FMod licenses.
I remember a few years ago, I was glad to find FMOD and be able to quickly develop an alternative to audioOpenAL with my own audioFMOD plugin just because I wasn't clever enough to install OpenAL "driver" on Windows, but that's another story.
I recently had a battle to get sampleAudio_1 with audioOpenAL working again (last time I tried was, er... two years ago), and not only building.
I'm using yake SVN trunk and I build my own dependencies with Visual Studio 2008 Express, and here is my experience. Sorry it's only Windows specific, but it might help as building was my main issue.
1st attempt) I was using
OpenThread 1.2dev2-osg0.9.5 sources,
OpenAL 1.1 SDK and
OpenAL++ sources to successfully build audioOpenAL, with these changes in openal++ code :
- remove "(unsigned char *)" in audiobase.cpp line 37
- replace "unsigned char" with "char" in audiobase.cpp lines 72
- replace "ALubyte" with "const ALchar" in audiobase.cpp lines 73
- replace "ALubyte" with "const ALchar" in audioenvironment.cpp lines 150 & 152
- replace "YieldCurrentThread" with "Yield" in streamupdater.cpp line 150
Audio plugin and sample compiled but no sound, OpenAL state of audio source stuck at "Initial" after pSource->play().
2nd attempt) I tried OpenSceneGraph related sources of OpenThread and OpenAL++ :
osgAL-0.6.1,
osg-2.8.0 src+deps with
cmake.
- As domfada said, OSG is a huge dependency. But it is required only because "small" things for OpenThread are in OSG core (class Referenced mainly).
To avoid building OSG, I just "extracted" the required code : with CMake I built only OpenThread from OSG sources as a static library, then I built oalpp from osgAL sources by defining OSG_LIBRARY (for static imports) and adding just these files (from osg core) : "ApplicationUsage.cpp, DeleteHandler.cpp, Notify.cpp & Referenced.cpp" to oalpp in the build process. I got less binaries, only OSG headers remain. - building audioOpenAL :
in yake\plugins\audioOpenAL\yakePCH.h, replace
#include <openalpp/alpp.h>
by
#include "openalpp/Export"
#include "openalpp/Source"
#include "openalpp/AudioEnvironment"
#include "openalpp/Listener"
#include "openalpp/GroupSource"
#include "openalpp/Sample"
#include "openalpp/FileStream"
in
*edited*yake\plugins\audioOpenAL\yakeAudioSystemOpenAL.h
*edited*, replace
openalpp::ref_ptr
with
osg::ref_ptr
and
openalpp::SourceBase
with
openalpp::Source
.
The lattest point took me time and debug sessions, only to figure out that openalpp::SourceBase::play() method is NOT virtual so some calls (loading audio data for streaming) were missing... I guess that's why my first attempt was a failure, but I don't want to spend more time on reading OpenAL++ sources.
I knowingly skipped some adjustments I needed in inlude paths and imported libs. If you need more details, feel free to ask
