OpenAL question - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: OpenAL question (/thread-2155.html)
OpenAL question - macnib - Nov 12, 2008 12:10 PM
Stuck on distance attenuation. Problem is things in the distance don't sound distant! Main issue is lots of things driving around in the environment and the player really only needs to hear what is close. Yet, everything sounds close.
So, I just want to do a sanity check. Read the docs.
The sounds play well. I read in an ogg file with quality level 6. ( I had ported alut but I got rid of it because its depricated .. no more wav files ) In Sound Studio, I made sure all of the sounds are within a 6db range for left and right.
Initially, I set the distance model to "AL_INVERSE_DISTANCE" . Listener and source gains to 1.
According to the documents, inverse distance attenuation is:
Dref/ ( Dref + Rfac * ( Distance - Dref )
For kicks, I set Dref to 1 and Rfac to 1. So, the equation should simplify to 1/Distance. Yet, things just seem as loud as ever. I'd assume if its at a distance of say 180 then the gain should be multiplied by 1/180 = 0.005555 . (?)
I checked that the source and listener positions are updated properly.
I set AL_MAX_DISTANCE to 200 which seems to work fine.
OpenAL question - OneSadCookie - Nov 12, 2008 12:36 PM
You're using mono sounds right? Stereo sounds aren't localized at all...
OpenAL question - macnib - Nov 12, 2008 01:22 PM
Hmm, looks like the sounds are not mono. I'll mix the sounds down to mono in Sound Studio. I'll try some collision sounds first and see what happens.
OpenAL question - macnib - Nov 12, 2008 01:41 PM
That seems to have solved the issue. Need to fine tune the settings! Thanks again!