by Chris » Wed Sep 25, 2019 4:22 pm
OpenAL Soft (or any other implementation with EFX) can do distance-based air absorption. To work properly, though, the game/engine needs to tell it the correct unit scale (the number of meters per in-game unit), and the absorption factor -- default is 0 so it doesn't affect apps not expecting it, while a factor of 1 applies extra high frequency attenuation by a realistic -0.05dB per meter (on top of the normal distance attenuation), and it can go up to 10 to really strengthen the effect.
Regarding muffling sound given blocking geometry, that can be done with obstruction. OpenAL+EFX has no problem doing that, however it's the engine's task to detect blockages between the listener and the given sound source to determine how much obstruction to apply given the material, depth, and angle. A 1cm x 1cm piece of wood directly in between the listener and source wouldn't attenuate as much as a 1m x 1m piece of stone, for example. That would then depend on having appropriate material definitions for textures (a default can be used that sounds "good enough" for general use, but having proper obstruction parameters for a given material would be better).
OpenAL Soft (or any other implementation with EFX) can do distance-based air absorption. To work properly, though, the game/engine needs to tell it the correct unit scale (the number of meters per in-game unit), and the absorption factor -- default is 0 so it doesn't affect apps not expecting it, while a factor of 1 applies extra high frequency attenuation by a realistic -0.05dB per meter (on top of the normal distance attenuation), and it can go up to 10 to really strengthen the effect.
Regarding muffling sound given blocking geometry, that can be done with obstruction. OpenAL+EFX has no problem doing that, however it's the engine's task to detect blockages between the listener and the given sound source to determine how much obstruction to apply given the material, depth, and angle. A 1cm x 1cm piece of wood directly in between the listener and source wouldn't attenuate as much as a 1m x 1m piece of stone, for example. That would then depend on having appropriate material definitions for textures (a default can be used that sounds "good enough" for general use, but having proper obstruction parameters for a given material would be better).