Re: Different audio levels between SOURCE_RELATIVE True/False
Chris Robinson <[email protected]>
| Newsgroups | gmane.comp.lib.openal |
|---|---|
| Message-ID | <[email protected]> |
On Friday, September 03, 2010 11:58:09 am [email protected] wrote: > A small test application is attached which shows this problem. I have a > single sound source traveling around a circle, the listener is on the > circle and will hear the source traveling past. > > With SOURCE_RELATIVE False the audio output is much loud/overloaded when > the source is closest to listener. Hi. It seems you have the listener orientation wrong: ALfloat ListenerOri[] = { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 }; Essentially, OpenAL will internally use the listener position/orientation to localize the source, and an incorrect orientation can cause OpenAL to improperly calculate the source's placement relative to the listener. When the source's AL_SOURCE_RELATIVE property is true, it skips that step since the source is given in localized coordinates already. So even though the source is placed 200 or so units away, the improper orientation can cause OpenAL to think it's much closer than it actually is. For reference, the default listener orientation is: ALfloat ListenerOri[] = { 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f }; The first three values are the 'at' vector (with -z going into the screen), and the last three are the 'up' vector (with +y going to the top of the screen), and they should always be at a 90-degree angle to each other. The 'right' vector is implied, calculated by taking the cross-product of the two given vectors. As for the clipping/overload, I can't say. I don't see anything that could cause it to go above a 1.0 volume. Is there perhaps clipping in the sound itself? Or maybe your system sound levels are too high? _______________________________________________ Openal mailing list [email protected] http://opensource.creative.com/mailman/listinfo/openal