Getting and setting up OgreOggSound

stickymango

16-10-2008 11:05:22

Heres a brief summary of how to get hold of OgreOggSound and integrate it into your applications.

Downloading:

There are two sources from which to get hold of the library, a pre-compiled zip archives which will be a milestone release, and the SVN repository which will be the bleeding edge/unstable current version. The following URL's will direct you to your chosen download type:

Pre-compiled zip archive:
* Milestone release marking a stable point in the library development

http://sourceforge.net/projects/ogreoggsound/

SVN:
* Current development version, not necessarily stable but actively maintained and benefiting from the latest bug fixes and enhancements. Once proven stable an archive release will be taken from this branch and added to the archive milestone release system.

https://ogreoggsound.svn.sourceforge.ne ... ound/trunk

* Snapshot of stable version, currently version 1.0, is available from:

https://ogreoggsound.svn.sourceforge.net/svnroot/ogreoggsound/tags/version%201.0

* A Eihort compatible version can now be downloaded from here, I shall endeavour to maintain this version with the latest additions until such time as to be unnecessary.

https://ogreoggsound.svn.sourceforge.net/svnroot/ogreoggsound/branches/Eihort

Additional dependencies:

You will also need the lastest version of OpenAL sdk: 1.1 which can be downloaded from here: http://www.softpedia.com/get/Programmin ... -SDK.shtml

If you want to multi-thread streamed sounds then BOOST Threads will also be required, NOTE:- by default this is enabled and therefore project paths and dependencies are preset to search for this. Should you wish to disable this support, simply change OGGSOUND_THREADED 1 to OGGSOUND_THREADED 0 in the OgreOggSoundPreReqs.h and remove all $(BOOST_ROOT) path references from the project.

BOOST Threads can be downloaded with this installer link: BOOST 1.34.1 OR for later versions Other Boost Versions, just select Threads as the only download option.

Naturally you will also need OGRE installed so follow the download instructions at http://www.ogre3d.org to install the latest version.

Install your dependency packages then check that the following Environment variables are created, BOOST_ROOT, OPENAL_SDK and OGRE_HOME, if not create them and point them to the appropriate directories. You are now ready to integrate things into your application.

Using in your app: ( MS Visual Studio 8/9 )

Add the following to your C/C++-->General-->additional include directories:

$(OPENAL_SDK)/include
$(BOOST_ROOT)
[OgreOggSound directory]/include


Add the following to your linker-->General-->Additional library directories:

$(OPENAL_SDK)/lib
$(BOOST_ROOT)/lib
[OgreOggSound directory]/lib


Add the following to your Linker-->Input-->Additional dependencies:

OgreOggSound[_d].lib


#include "OgreOggSound.h"

using namespace OgreOggSound;
wherever you reference OgreOggSound functions.

Add 'OgreOggSound[_d]' to your plugins.cfg file / call Root::loadPlugin("OgreOggSound[_d]") in your code to use the automation of the plugin system, you can simply call "OgreOggSoundManager::getSingletonPtr()" to get a pointer to the manager. Creation/destruction is handled automagically :)

OgreOggSound uses OGRE's resource management system so you'll need to register sound folders with OGRE using the following:Ogre::ResourceGroupManager::getSingleton().addResourceLocation("path", "FileSystem", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, false) ;
save and compile, don't forget to copy the OgreOggSound[_d].dll into your application folder :)

swifft

04-10-2010 22:01:06

When I download and compile OgreOggSound I get
ogresdk_vc8_v1-7-1\include\ogre\threading\ogrethreadheadersboost.h(34) : fatal error C1083: Cannot open include file: 'boost/thread/detail/lock.hpp': No such file or directory.

I have followed all the steps and setup the Env. vars properly. I am using:

OgreSDK_vc8_v1-7-1
http://sourceforge.net/projects/ogreoggsound/
boost_1_42 that comes with OgreSDK_vc8_v1-7-1
OpenAL SDK 1.1

stickymango

05-10-2010 09:22:31

Does that file exist?

maybe there's a new dependency for 1.42 required, I don't use that version of boost so its unsupported, although I guess it should be an easy fix.

I know from 1.38 --> 1.40 I had to also include datetime when installing just the thread lib, maybe there's another lib you now need to include?

mkultra333

07-11-2010 10:57:33

Just started using OgreOggSound today, after failing with some other Ogre-OpenAL projects.

Looks great, I got it compiling and loading the dll in my project, and it played some sound. Super!

I'd add the following setup suggestions for things that stumped me a bit. If it's wrong feel free to correct it.

I went with the "OGGSOUND_THREADED 0" option to simplify things (had a little trouble with it not finding OGRE or BOOST_ROOT prior to that, even though I thought I'd replaced the boost location with the one I use for my ogre compiling.)

When you add the dll to your project, you need to add
#include "OgreOggSound.h"
before you can use it.

Just add
Plugin=OgreOggSound
to your Plugins.cfg file, you don't need the .dll extension.

I added my sound folder to the resources config but it didn't find them, so I added the location manually like this:

ResourceGroupManager::getSingleton().addResourceLocation("C:/Ogre/BSP/BZN/media/sound", "FileSystem",ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, false) ;



Then you can do a simple test to see if it's working, which I stole more or less from another thread:
OgreOggSound::OgreOggSoundManager* mSoundManager ;

// setup pointer to sound manager
mSoundManager = OgreOggSound::OgreOggSoundManager::getSingletonPtr();
mSoundManager->init() ;
mSoundManager->createSound("Sound1", "YourTestNoise.wav", false, false, true) ;

mSoundManager->getSound("Sound1")->play();


That's as far as I've gotten so far, but it's sounding good.

stickymango

08-11-2010 11:37:15

Fair comments, I'll review them. :)

oln

09-11-2010 16:42:35

I've also started using OgreOggSound for the OpenDungeons project (currently only music, haven't tested the positional bit yet). It works fine under ubuntu as well, but I had the issue that loading the plugin didn't load properly when it was called libOgreOggSound.so, had to remove the lib prefix. Also, the install script currently installs it into where the ogre libs are, not the plugins, not sure how that should be done as it has to be both linked and loaded as plugin. I just copied it to the plugin dir as a workaround, but it may not be the best solution.

oln

10-11-2010 22:38:54

Using OgreOggSound in linux(ubuntu)

Get the preferred version from SVN. (As mentioned in the first post.)
E.g in the directory you want to build in:

svn co https://ogreoggsound.svn.sourceforge.net/svnroot/ogreoggsound/trunk


To install dependencies in Ubuntu (assuming Ogre already is installed, and the use of boost threads):

apt-get install libboost-thread-dev libopenal-dev libvorbisfile3 libvorbis-dev libogg-dev


Currently efx has to be disabled to build on linux, so open include/OgreOggSoundPrereqs.h and change HAVE_EFX 1 to HAVE_EFX 0 at the top.
(Should be possible to do with the cmake command line as well.)

To build and install:

cd where/you/put/ogreoggsound/
cmake -DUSE_POCO=FALSE .
make
sudo make install

(if using poco, remove "-DUSE_POCO=FALSE")

To use it as a plugin, I had to copy it to the ogre plugins directory (/usr/lib/OGRE or similar), and rename it to OgreOggSound.so .

stickymango

10-11-2010 23:48:51

Thanks a lot for this, I'm completely reliant on linux savvy users to help ensure compatibility, think I'll make this a sticky. :)

Much appreciated!

oln

11-11-2010 18:50:01

I had to change HAVE_EFX to 0 to get the latest svn to build on linux. Latest version of OpenAL-soft does have the efx stuff (though file wasn't included), but it doesn't have some of the EAX specific things.

stickymango

12-11-2010 10:15:46

Hmmm,

Which specific things are missing?

is it worth sectioning that code further with optional #define guards?

Thanks.

[Edit] moved define into windows build, so by default EFX support is disabled in all other builds..[/Edit]

oln

12-11-2010 21:39:17

It complains about these:
In file included from /media/edisk1/opendungeons/ogreoggsound/ogreoggsound/trunk/src/ogreoggstreamsound.cpp:31:
/media/edisk1/opendungeons/ogreoggsound/ogreoggsound/trunk/include/OgreOggSoundManager.h:425: error: ‘EAXREVERBPROPERTIES’ has not been declared
/media/edisk1/opendungeons/ogreoggsound/ogreoggsound/trunk/include/OgreOggSoundManager.h:824: error: ‘EFXEAXREVERBPROPERTIES’ has not been declared
/media/edisk1/opendungeons/ogreoggsound/ogreoggsound/trunk/include/OgreOggSoundManager.h:937: error: expected ‘)’ before ‘*’ token
/media/edisk1/opendungeons/ogreoggsound/ogreoggsound/trunk/include/OgreOggSoundManager.h:938: error: expected ‘)’ before ‘*’ token
/media/edisk1/opendungeons/ogreoggsound/ogreoggsound/trunk/include/OgreOggSoundManager.h:940: error: ‘LPEAXSETBUFFERMODE’ does not name a type
/media/edisk1/opendungeons/ogreoggsound/ogreoggsound/trunk/include/OgreOggSoundManager.h:941: error: ‘LPEAXGETBUFFERMODE’ does not name a type
make[2]: *** [CMakeFiles/OgreOggSound.dir/src/ogreoggstreamsound.cpp.o] Error 1
make[1]: *** [CMakeFiles/OgreOggSound.dir/all] Error 2
make: *** [all] Error 2

TheTom

14-11-2010 22:04:27

We are also using OgreOggSound for our crossplatform game and with linux I get some errors concerning some efx member variables. With the following patch it works for me (it seems uploading .patch files is not allowed...):

=== modified file 'src/ogreoggsoundmanager.cpp'
--- src/ogreoggsoundmanager.cpp 2010-11-11 09:45:22 +0000
+++ src/ogreoggsoundmanager.cpp 2010-11-14 21:52:56 +0000
@@ -57,6 +57,7 @@
,mDevice(0)

,mContext(0)

,mListener(0)

+#if HAVE_EFX

,mEAXSupport(false)

,mEFXSupport(false)

,mXRamSupport(false)

@@ -68,6 +69,7 @@
,mCurrentXRamMode(0)

,mRecorder(0)

,mEAXVersion(0)

+#endif

,mDeviceStrings(0)

,mMaxSources(100)

,mResourceGroupName("")

@@ -2325,14 +2327,14 @@
SourceList::iterator it = mSourcePool.begin();

while (it != mSourcePool.end())

{

+#if HAVE_EFX

if ( hasEFXSupport() )

{

-#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32

// Remove filters/effects

alSourcei(static_cast<ALuint>((*it)), AL_DIRECT_FILTER, AL_FILTER_NULL);

alSource3i(static_cast<ALuint>((*it)), AL_AUXILIARY_SEND_FILTER, AL_EFFECTSLOT_NULL, 0, AL_FILTER_NULL);

-#endif

}

+#endif

alDeleteSources(1,&(*it));

++it;

}

stickymango

15-11-2010 11:11:57

Thanks for that, I'll review it! :)

oln

25-11-2010 22:06:15

Tried to build the windows version, i had to add "$(OPENAL_SDK)\libs\Win32\EFX-Util_MTDLL" to the linker directories, as efx_util.lib was in there. (Using OpenAL SDK 1.1) Not sure if that's normal or not, but it was in mye case.

stickymango

25-11-2010 23:18:59

Odd,

Thats not the case on any of my machines but thanks for the heads up.

gioramies

15-03-2011 17:56:29

Hello everybody.

I have been trying to compile OgreOggSound by myself using MinGW and Codeblock but I get the following errors:

||=== OgreOggSound, Release ===|
ld.exe||cannot find -lEFX-Util.lib|
ld.exe||cannot find -lOpenAL32.lib|
ld.exe||cannot find -lvorbis_static.lib|
ld.exe||cannot find -lvorbisfile_static.lib|
ld.exe||cannot find -logg_static.lib|
||=== Build finished: 5 errors, 0 warnings ===|

I installed OpenAL 1.1 SDK and set the %OPENAL_SDK% variable. The problem is that i don't know why these errors appears if I set the compiler and linker directories. I saw this (http://www.mingw.org/wiki/Specify_the_libraries_for_the_linker_to_use) and then I renamed the libraries like -l<name>.lib but the error persists. I tried almost everything I know, but I couldn't compile it. I read somethings here in the forum but that haven't been enough for me, so, can anyone help plis?

Thanks in advance.

alcx

24-03-2012 10:23:00

Hi,
just wanted to let you know that it would be useful to add that you need to add the namespace OgreOggSound - I was checking include files and didn't know why there was no OgreOggSoundManager.
And another really important suggestion - please add OgreOggSound to
http://www.ogre3d.org/tikiwiki/Sound+an ... e=Cookbook

I tried them all - none worked, all were outdated and I find out about this one after spending hours trying out other libs.
You are doing a great job!
Thank you.

Best regards,
Alex

stickymango

28-03-2012 14:43:29

Thanks for the kind remarks, I'll look into the wiki page idea.

Yati

02-05-2012 07:02:26

Great library! But I can't seem to find a function that does this:

How would you apply a effect like reverb to every sound in the scene?

alphaXomega

10-07-2012 09:04:21

Hi Sticky,

I am trying to get OgreOggSound to work with OpenAL-soft. I have compiled everything, defined HAVE_EAX to be 0, and got the dll/libs/include in the right place.

When I run, the init() fails because of "Unable to get OpenAL Minor Version number". How would I go about this? The reason I am using OpenAL-soft is to avoid Creative's OpenAL SDK licensing as well as FMOD/etc...

Thank you very much for your time.

stickymango

27-08-2012 21:57:54

I presume that information isn't available from the version of OpenAL-soft you have, although I did do a search for it and it looked like you should be able to get that info with the code I'm using.. Anything in the docs? You could just comment the check out...

xypher

26-10-2013 03:52:17

Sorry to ressurect a dead horse, but I'm presently being faced with the same issue, OpenAL-Soft 1.2.3, as the creative site now appears to be down.

It appears that as a result of a null context alGetError is spitting out an AL_INVALID_OPERATION value during SoundManager init. I'm working on this now, and will hopefully have a resolution soon.

xypher

26-10-2013 03:57:23

Success. I'm not going to call this a definitive patch, because it obviously removes some safety checking that might make sense, however it appears that since OpenAL-Soft 1.2.3 returns AL_INVALID_OPERATION from alGetError() before creating a context, using alGetError() prior to that is pointless.

I am currently on Windows 8.

ogreoggsoundmanager.cpp:271:

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
ALenum error = AL_NO_ERROR;

//alGetError();
alcGetIntegerv(NULL, ALC_MAJOR_VERSION, sizeof(majorVersion), &majorVersion);
//error = alGetError();
if (error != AL_NO_ERROR)
{
switch (error)
{
case AL_INVALID_NAME: { LogManager::getSingleton().logMessage("Invalid Name when attempting: OpenAL Minor Version number", Ogre::LML_CRITICAL); } break;
case AL_INVALID_ENUM: { LogManager::getSingleton().logMessage("Invalid Enum when attempting: OpenAL Minor Version number", Ogre::LML_CRITICAL); } break;
case AL_INVALID_VALUE: { LogManager::getSingleton().logMessage("Invalid Value when attempting: OpenAL Minor Version number", Ogre::LML_CRITICAL);} break;
case AL_INVALID_OPERATION: { LogManager::getSingleton().logMessage("Invalid Operation when attempting: OpenAL Minor Version number", Ogre::LML_CRITICAL); }break;
case AL_OUT_OF_MEMORY: { LogManager::getSingleton().logMessage("Out of memory when attempting: OpenAL Minor Version number", Ogre::LML_CRITICAL); } break;
}
LogManager::getSingleton().logMessage("Unable to get OpenAL Major Version number", Ogre::LML_CRITICAL);
return false;
}

//alGetError();
alcGetIntegerv(NULL, ALC_MINOR_VERSION, sizeof(minorVersion), &minorVersion);
//error = alGetError();
if(error != AL_NO_ERROR)
{
switch (error)
{
case AL_INVALID_NAME: { LogManager::getSingleton().logMessage("Invalid Name when attempting: OpenAL Minor Version number", Ogre::LML_CRITICAL); } break;
case AL_INVALID_ENUM: { LogManager::getSingleton().logMessage("Invalid Enum when attempting: OpenAL Minor Version number", Ogre::LML_CRITICAL); } break;
case AL_INVALID_VALUE: { LogManager::getSingleton().logMessage("Invalid Value when attempting: OpenAL Minor Version number", Ogre::LML_CRITICAL);} break;
case AL_INVALID_OPERATION: { LogManager::getSingleton().logMessage("Invalid Operation when attempting: OpenAL Minor Version number", Ogre::LML_CRITICAL); }break;
case AL_OUT_OF_MEMORY: { LogManager::getSingleton().logMessage("Out of memory when attempting: OpenAL Minor Version number", Ogre::LML_CRITICAL); } break;
}
LogManager::getSingleton().logMessage("Unable to get OpenAL Minor Version number", Ogre::LML_CRITICAL);
return false;
}

#else

shenjoku

19-11-2013 03:00:47

As far as I can tell, the current ogreoggsound-1.23.7z file is corrupt. 7zip won't recognize it as a valid archive.

stickymango

19-11-2013 09:43:25

Okay, will try to update this asap.

shenjoku

21-11-2013 21:07:26

Which revision in SVN is linked to the latest release? I can't find any tags or commit messages mentioning the build number.

stickymango

21-11-2013 22:00:41

Hi,

Revision 426 is the latest version.