[Solved] All sounds get equal volumes
My sounds all sound from both speakers at the same volume even when they are at different positions from my listener, i.e. I can't get 3D positioning to work. My sounds are mono wavs. And I have tried the to replace my sounds with the sounds in the OgreOggSound demo.
I create and init the sound manager with:
LOG_ERROR("SoundManager failed to initialize.");
I attach the listener like this:
And attach sounds to nodes like this:
OgreOggSound::OgreOggISound* sound =
Earlier I have used OgreAL in much the same manner, but with OgreAL I got 3D positioning to work (for a while til the usual OgreAL bugs kick in). OgreOggSound seems to be more stable so I gave it a shot, but now I am stuck.
Help would be much appreciated.
The node you are attaching the listener to is the camera not the same as the sound nodes isn't it?
Its not obvious from your code snippet
The only other issue is non mono sounds..
You are right I could have bee more specific.
I attach the listener to the camera and the sounds to other nodes moving in the world.
(I guess the best thing to do would be to create a very small minimal examples and see if it works. And if it don't then post the code here. Gonna do that as soon as I have time)
Are you calling OgreOggSoundManager::update(fTime) in your idle loop?
I didn't, but now I do.
Stereo and attenuation works flawlessy, but only I after I also removed the line:
That is when I do not specify a distance model.
When/if I change the distance model to AL_LINEAR_DISTANCE, AL_INVERSE_DISTANCE or AL_EXPONENT_DISTANCE, then the sounds will be played at the maximum volume not depending on distance. I have tried different values for MaxDistance, ReferenceDistance, and RolloffFactor, but they don't seem to have any noticable effect when I use any of the above mentioned models.
Hmmm, thats strange as I generally only use AL_LINEAR_DISTANCE and have no problems.
Im having the same problem here, removed that line and everything worked.
Hmmm, does the demo still work okay?
Didnt tried the demo very much, but the yellow monsters should emit a 3d sound? I dont think its working either, later i'll give you a better answer, since right now i can barely test it.
17:21:05: *** --- Initialising OpenAL --- ***
17:21:05: *** --- OpenAL version 1.1
17:21:05: *** --- AVAILABLE DEVICES --- ***
17:21:05: *** --- Generic Hardware
17:21:05: *** --- Generic Software
17:21:05: *** --- Choosing: Generic Hardware (Default device)
17:21:05: *** --- OpenAL Device successfully created
17:21:05: *** --- OpenAL Context successfully created
17:21:05: *** --- SUPPORTED FORMATS
17:21:05: *** --- AL_FORMAT_MONO16 -- Monophonic Sound
17:21:05: *** --- AL_FORMAT_STEREO16 -- Stereo Sound
17:21:05: *** --- AL_FORMAT_QUAD16 -- 4 Channel Sound
17:21:05: *** --- AL_FORMAT_51CHN16 -- 5.1 Surround Sound
17:21:05: *** --- AL_FORMAT_61CHN16 -- 6.1 Surround Sound
17:21:05: *** --- AL_FORMAT_71CHN16 -- 7.1 Surround Sound
17:21:05: *** --- EFX Detected
17:21:05: *** --- 1 Auxiliary Effect Slot(s)
17:21:05: *** --- 1 Auxiliary Send(s) per Source
17:21:05: *** --- EFFECTS SUPPORTED:
17:21:05: *** --- 'Reverb' Support: YES
17:21:05: *** --- 'EAX Reverb' Support: YES
17:21:05: *** --- 'Chorus' Support: NO
17:21:05: *** --- 'Distortion' Support: NO
17:21:05: *** --- 'Echo' Support: NO
17:21:05: *** --- 'Flanger' Support: NO
17:21:05: *** --- 'Frequency shifter' Support: NO
17:21:05: *** --- 'Vocal Morpher' Support: NO
17:21:05: *** --- 'Pitch shifter' Support: NO
17:21:05: *** --- 'Ring modulator' Support: NO
17:21:05: *** --- 'Autowah' Support: NO
17:21:05: *** --- 'Compressor' Support: NO
17:21:05: *** --- 'Equalizer' Support: NO
17:21:05: *** --- FILTERS SUPPORTED:
17:21:05: *** --- 'Low Pass' Support: YES
17:21:05: *** --- 'High Pass' Support: NO
17:21:05: *** --- 'Band Pass' Support: NO
17:21:05: *** --- XRAM NOT Detected
17:21:05: *** --- EAX 2.0 Detected
17:21:05: *** --- Created 22 sources for simultaneous sounds
17:21:05: *** --- Using BOOST threads for streaming
17:21:05: *** --- OpenAL Initialised --- ***
If you could check that would be great, also could you try initialising with:
and see if that works differently...
I get the same error. Unless I use software mode, all sounds are played at equal volume no matter what distance model I use. If I don't force software mode though and don't add a distance model, I get 3d sound.
Should I force software mode on, to be sure that every one using the program will get the same experience?
It would seem that it always works if you use 'Generic Software' mode, however that shouldn't be necessary, I think the bottom line is a driver problem with your current hardware which you should try to rectify.
I'll try and update the driver, and get a log before and after. Unless I can detect whats causing it, I'll have to force software mode, as I wouldn't want people that have the same issues to get a sound overload when they start the program.
I'm pretty certain its nothing to do with the library as I have a duff soundcard on one of my test machines which exhibits this same behaviour, it also didn't attenuate properly, i.e. on the OgreAL Directional demo it only updated the attenuation when you stopped/started the playback, flying around made no difference to attenuation, however every other machine I tested on worked fine, as did using 'Generic Software' mode on the duff machine, so I can only assume some soundcards/drivers have issues with OpenAL 3D playback...
For final deployment, as long you offer the user a sound card choice and maybe add a troubleshoot section explaining the possible issue, I think you can safely default to 'Generic Hardware'. If you manage to correct the problem on your system then add that info too, let me know how you sorted it if you do!
I promish. I'm at work right now, and can't test the hardware problem here, as the soundcards at work have no issues, but I'll try updating when I get home, and then later let openAL/OgreOggSound choose a default, with a user option to override like you suggested.
I updated my realtek audio driver, and now I have 3d sound using hardware. There arn't any difference in the ogreoggsound logging between the two drivers, so I'm assuming it must be OpenAL that's having trouble detecting the correct settings, as fmod worked with 3d sound.
Anyway, I will do as you say, and add an override in setup, plus a adding to the troubleshoot section that updating audio drivers might solve it if people experience trouble.
Ty for your help
So its working okay now?
Yep - the driver update did the trick.
That is "fun" i used to have the same problem, so i placed a OgreManager.Update call into my idle loop.
Now the Orgre object witch has the sound attached to it, cannot hit other objects ! it simply pass threw everything
if i remove the Update, then collision come back, but then volume still equal all the time again.
i'll do more test tomorow (sooo late now 5am). But this behavior is funny isn't it?
Interesting, I've looked through the code and noticed that I wasn't calling some subclassed virtual functions in my implementations, namely in _notifyMoved(), don't know if this maybe causing your issues but I've committed a fix to the SVN version of the lib, try downloading it and see if it fixes the issues.
I've test it, and it's works fine now !
You re the King
Thank you for your fast reaction.
I keep testing your library that looks very good, my teamates and I will probably use it for our futur game.
Woohoo! thats great news, thanks for spotting it!