(environmental) audio effects

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
Max Power
Posts: 98
Joined: Wed Mar 14, 2012 10:09 am

(environmental) audio effects

Post by Max Power »

Yesterday I wanted to improve my openAL SoundManager with audio effects. I found that the only effect (of around 10) supported by my device is reverb, which is a bit disappointing :(

I quickly switched to openAL soft, but it's the same thing.


After googling it seems to me that hardware-driven audio effects are pretty much a thing of the past. Now I'd like to know what hardware-independent alternatives there are. It should be free, at least for low budget projects, and cross-platform.
Maybe I should try fmod?

Or maybe there's even a way to have openAL apply its effects in a compatibility-mode kind of way?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: (environmental) audio effects

Post by hendu »

You sure you installed al-soft correctly? I have an old version, and mine lists
EAX Reverb, Reverb, Echo, Ring Modulator, Dedicated Dialog, Dedicated LFE

http://kcat.strangesoft.net/openal.html
The latest changelog says

Implemented EFX Chorus, Flanger, Distortion, Equalizer, and Compressor effects.
Max Power
Posts: 98
Joined: Wed Mar 14, 2012 10:09 am

Re: (environmental) audio effects

Post by Max Power »

Does it just list them or can you actually apply the effects?
To know whether your device supports any of the effects you have to try and set their type for a generated effect like this:

Code: Select all

    ALuint effect[AL_EFFECT_EQUALIZER];
    LPALGENEFFECTS alGenEffects = (LPALGENEFFECTS)alGetProcAddress("alGenEffects");
    LPALEFFECTI alEffecti = (LPALEFFECTI)alGetProcAddress("alEffecti");
 
 
    for (int i = AL_EFFECT_NULL; i <= AL_EFFECT_EQUALIZER; i++)
    {
        alGenEffects(1, &effect[i]);
        if (alGetError() != AL_NO_ERROR)
        {
            printf("Failed to Create Effect %d!\n", i);
            break;
        }
        alEffecti(effect[i], AL_EFFECT_TYPE, i);
        if (alGetError() != AL_NO_ERROR)
            printf("effect type %d not supported\n", i);
        else
            printf("effect type %d supported\n", i);
    }
I left my code completely unchanged after switching to oal soft. It's completely the same API, so I basically just changed include directories and libraries. But I will check again, if I may have overlooked something.
Max Power
Posts: 98
Joined: Wed Mar 14, 2012 10:09 am

Re: (environmental) audio effects

Post by Max Power »

After wondering why my .exe doesn't seem to care about the soft_oal.dll but still requires OpenAL32.dll to run, I just read in the oal soft readme that you can rename soft_oal.dll to OpenAL32.dll, although it will come at the expense of hardware support, if I got that right.

Well, I did that and now most of the effects are supported, it seems. Gonna play around with it a little now.



Ok, thank you! Working now. Only problem is that most (all?...) effects completely mess up the spatial component of my sounds. Like distances and directions from the listener are being ignored entirely.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Re: (environmental) audio effects

Post by devsh »

try RAYA, it raytraces audio effects against simple scene geometry... apparently it got 50fps on 10% CPU utilization and 10mb of data on a Quake 3 level

maybe if you gave it a dedicated thread/core you could tackle quite complex geometries (with appropriate sound-geometry LoD scheme)
Post Reply