[openal] Porting from XAudio2 to OpenAL - few questions

Mariusz 'MX' Szaflik mxadd at o2.pl
Mon Mar 24 03:37:04 EDT 2014


I'm porting some XAudio2 code to OpenAL (latest OpenAL on ubuntu) ... 
and I have some trouble with reverb.
First of all my reverb parameters are expressed in i3dl standard (xaudio 
uses ReverbConvertI3DL2ToNative to convert from i3dl to it's native format)
is there around some source code for doing that same and converting from 
i3dl to AL_EFFECT_EAXREVERB set of params ?
(once uppon time there was lib from creative to do that, but it was 
windows only and no source code was provided)

My second problem is that XAudio2 is setup in the way that each voice 
(source) have two sends one to the master voice (dry path)
and one to the reverb voice - then to the master voice (wet path).

Is there any way to do this in OpenAL ?
for now i have:

alGenEffects( 1, &reverbEffect );
alGenAuxiliaryEffectSlots( 1, &reverbSlotID );
alEffecti( reverbEffect, AL_EFFECT_TYPE, AL_EFFECT_EAXREVERB );

alEffect*(reverbEffect, AL_EAXREVERB_*, ...); // set all reverb params

alGenSources( 1, &source1 );
alSource3i( source1, AL_AUXILIARY_SEND_FILTER, reverbSlotID, 0, NULL );

alGenSources( 1, &source2 );
alSource3i( source2, AL_AUXILIARY_SEND_FILTER, reverbSlotID, 0, NULL );

... this works fine but gives me only wet path
and what should the setting looks like when i want for example the 
source1 to be 50% wet and 50% dry in the final mix ?
(the only thing in my mind now is to duplicate source1 into source1dry 
and source1wet, bind the reverb for the wet only and play with the 
AL_GAIN set to half of the original for both sources, but this adds
some crazy complexity to sources/buffers management - so i hope there is 
a better way to do this)

and another question:
what is most efficient way to set LowPass filter per source (assuming 
that i need 'global' reverb to)
-- per source since it's parameters depends on distance from listener 
(and other in-engine-calculated-factors like occlusion) ?

Sorry if the questions are basic ones, but I did'n played much with 
openAL until now (i'm mainly XAudio / FMOD programmer ;))

More information about the openal mailing list