I think the echo you are refering to is in not even caused by not playing sources in sync or not feeding the buffers correctly, but by OpenAL spatializing the sound. E.g. you get feeback from the left channel on the right and the other way. I hear the effect also in the applause in the Ryan Addams ogg files.
The theory with advancing one source is that if one source is 20ms ahead you should ffwd the other source by 20ms or slow down the other source. Also when feeding data to the buffer you could skip the first 20ms of data for the buffer that is behind. But i did not get good results with either method.
For the spatializing, we can make that partially good be setting up the OpenAL environment.
Code:
alDistanceModel( AL_INVERSE_DISTANCE );
(Yes there is a nasty typo bug in the openal.pas again.)
And set up sources like:
Code:
alSource3f(sourceL, AL_POSITION, -5.5, 0, 0.0);
alSource3f(sourceL, AL_VELOCITY, 0, 0, 0);
alSource3f(sourceL, AL_DIRECTION, 0, 0, 0);
alSourcef(sourceL, AL_ROLLOFF_FACTOR, 1.5);
alSourcei(sourceL, AL_SOURCE_RELATIVE, AL_FALSE);
alSource3f(sourceR, AL_POSITION, 5.5, 0, 0.0);
alSource3f(sourceR, AL_VELOCITY, 0, 0, 0);
alSource3f(sourceR, AL_DIRECTION, 0, 0, 0);
alSourcef(sourceR, AL_ROLLOFF_FACTOR, 1.5);
alSourcei(sourceR, AL_SOURCE_RELATIVE, AL_FALSE);
It is not correct with this, but you can use this to control it a bit.
Bookmarks