Positional Sound


03-02-2009 15:26:23


After following the setup instructions and spending a lot of time on it, i finally can manage sounds in my little apllication (play, pause, stop, ...).

But nevertheless i am not able to set positional sounds, i've been searching the web and the forum for days now, but i can't get into it. Here's what i'm doing...

soundManager = OgreOggSound::OgreOggSoundManager::getSingletonPtr() ;
soundManager->init() ;
soundManager->setDistanceModel(AL_LINEAR_DISTANCE) ;

OgreOggSound::OgreOggISound* sound = soundManager->createSound("Sound","sound.ogg",false,false,false) ;
sound->setRelativeToListener(false) ;
roboNode->attachObject(sound) ;

camNode->attachObject(OgreOggSound::OgreOggSoundManager::getSingletonPtr()->getListener()) ;

In my framelistener class i move the camera and update the soundmanager on every started frame

Ogre::Vector3 walkSpeed(0,0,25);

OgreOggSound::OgreOggSoundManager::getSingletonPtr()->update(evt.timeSinceLastFrame) ;

i've been playing around with all options from setting the rolloffactor or maxdistance to removing soundManager->setDistanceModel(AL_LINEAR_DISTANCE) or setting setRelativeToListener on true
...but no effect at all, the sound (which btw is a mono sound) is not changing.

what am i doing wrong?


04-02-2009 12:00:46

ok...after playing around for some time it now works, except for two problems:

1) the centre of the sound is not at the node of the robot, to whom i attached the sound, but at the position of the cameranode, where i attached the listener

2) the emitted sound is not really 3d, so when i walk left, i don't hear anything on my left ear and the other way around...but thats not the way it should be, as the sound should become louder or more quiet according to my position, so that i still hear the sound on both sides, not only on one..

what could be the reason for that?


05-02-2009 14:24:35


Can you post some code of what you have done and maybe attach the log output also.

I have known incorrectly installed drivers cause random problems with positional sounds, indeed I have a system I use which has this problem, for it to work correctly I have to use the "Generic Software" device. If you try that and see if it cures the problem then it will be down to a driver problem, otherwise I don't know blindly what could be the problem, I use 3D sounds in my apps and have no problems.. :?


09-02-2009 11:07:43

well..i have switched to ogreal, because everything there worked out of the box...but thanks for your help!


09-02-2009 11:21:29

Thats a shame, hope its okay for you.