No Volume change in 3D sounds.

Crhonos

23-04-2014 02:56:58

So I have been struggling to make the volume change when using 3D sounds(change because of distance).

I got the playernode(in the player object) where I attach the listener :
objectnode->attachObject(sound->mSoundManager->getListener());

And then I have the 3D sound to play in another object(the enemy object):
sound2 = mSoundManager->createSound("Sound1", "pow.wav",false,false,false,0,false);
objectnode->attachObject(sound2); //not the same objectnode as above, this is in another class
sound2->setRolloffFactor(4.f);
sound2->setReferenceDistance(10);


And i Can play the sound whenever I press P:
if (inputsystem->keyboardcheckpressed(OIS::KC_P))
{
sound2->play();
}


In framerenderingqueue I got
soundcontrol.mSoundManager->update(evt.timeSinceLastFrame);

Well, my problem is, I can play the sound(it's a Mono channel sound), and it feels 3D, if I move the listener around(or the object who plays the sound) I hear the sound coming from different parts of my headphones, but at the same time, it does not matter the distance the listener is to the soundplayer, the sound is always at full volume, the volume is not changing at all. Any ideas of a mistake I'm probably doing?
(For example, the listener is 600 units of distance [IDK the unit of distance in Ogre, is it meters?] and it plays the full volume, or listener is in the same position from soundplayer and the volume still the same)

Crhonos

23-04-2014 04:12:37

Well, I started to play a lot with rolloffactor and distance and got some results, this might be resolved, I just wonder how the rolloffactor works...

stickymango

06-05-2014 22:19:36

Check out: http://www.openal.org/documentation/openal-1.1-specification.pdf