[openal] Noob questions on oepnAL

Chris Robinson chris.kcat at gmail.com
Thu Jan 7 01:20:47 EST 2016

On 01/06/2016 07:11 AM, Massimiliano Maini wrote:
> Let's say that my listener is standing still in the origin ([0,0,0]) of my
> reference frame with the "at" vector pointing as the +Y axis and the "up"
> vector pointing as the +Z axis (so with respect to the listener +X is
> right, +Y is forward, +Z is up).
> If I have a non-directional source (no distance-based attenuation and no
> movement):
>   A - located along the 'at" axis (e.g. [0, +10, 0])
>   B - located to the left of the listener (e.g. [-10, 0, 0])
> In case A, the sound on the left and right output channels (e.g. out of an
> headphone) is identical, fine.
> But what about case B: is there anything on the right channel (that is
> "looking away" from the source) ? In a specific game I have at hand, I seem
> to hear no sound on the channel that is "looking away" from the source. Is
> this implementation dependent ?


Yes, this is implementation- and system-dependent. For normal stereo 
speaker output, you generally want the left channel to not be influenced 
by the right, and vice-versa. OpenAL Soft 1.17+ at least (I can't speak 
for other implementations) will try to detect headphones and 
automatically enable HRTF, or a simple crossfeed filter. This is 
dependent on the backend system properly reporting whether the output is 
for headphones or not, though.

> So digging I've now found the HRTF stuff in ALsoft. Which made me ask
> myself: in usual openAL (e.g. the one provided by Creative), what is the
> HRTF of the listener ?

I don't know about Creative's drivers, but OpenAL Soft's default HRTF is 
the MIT KEMAR data set. Users can make and install different sets to 
either replace them, or add extra ones to be enumerated.

> Also, if I were to use ALsoft and its HRTF feature, i would get some sound
> in my case B above right ? (assuming the HRTF is not zero at 180deg azimuth)

Yes, with HRTF, sounds that reach the left ear would also play quietly 
from the right channel after a short delay, and vice-versa.

More information about the openal mailing list