# HG changeset patch # User reimar # Date 1165666454 0 # Node ID b755687aa485f058b722d5ec317ad791ee15627b # Parent 06d8fa9450b7996c55868b1bc9eb9f3b82450fac Improve OpenAL speaker positions a bit. diff -r 06d8fa9450b7 -r b755687aa485 libao2/ao_openal.c --- a/libao2/ao_openal.c Sat Dec 09 11:59:49 2006 +0000 +++ b/libao2/ao_openal.c Sat Dec 09 12:14:14 2006 +0000 @@ -61,12 +61,11 @@ static int init(int rate, int channels, int format, int flags) { float position[3] = {0, 0, 0}; - float direction[6] = {0, 0, 1, 0, 1, 0}; + float direction[6] = {0, 0, 1, 0, -1, 0}; float sppos[6][3] = { - {-1, 0, 1}, {1, 0, 1}, - {-1, 0, -1}, {1, 0, -1}, - {0, 0, 0}, - {0, 0, 0} + {-1, 0, 0.5}, {1, 0, 0.5}, + {-1, 0, -1}, {1, 0, -1}, + {0, 0, 1}, {0, 0, 0.1}, }; ALCdevice *dev = NULL; ALCcontext *ctx = NULL; @@ -100,6 +99,8 @@ alSourcefv(sources[i], AL_POSITION, sppos[i]); alSource3f(sources[i], AL_VELOCITY, 0, 0, 0); } + if (channels == 1) + alSource3f(sources[0], AL_POSITION, 0, 0, 1); ao_data.channels = channels; alGetBufferi(buffers[0][0], AL_FREQUENCY, &bufrate); ao_data.samplerate = rate = bufrate;