[openal] Attenuation Roll-Off problems (too silent)

Roland Plüss roland at rptd.ch
Sun May 22 09:26:05 EDT 2022


Let's take a look at a concrete example. Maybe you can then shed some 
light on how this is supposed to work from OpenAL perspective.

Let's say I have a room of roughly 7x4m size. In the middle of the room 
there is a sound source playing the sound of some kind of engine/motor 
hence a looping, uniform sound. Since it is in the middle of the room 
the sound source is 3.5m away from the door. The listener is located in 
the door hence 3.5m away from the sound source. The volume of the source 
is set to 1, reference distance to 1 and roll-off to 1. At the door the 
sound is pretty much inaudible. That's what I got right now.

The sound file is normalized with peak gain at 0db. Audacity measures 
the RMS as -13.74 db. This would be a mean volume of roughly 0.2. 
Physically this would be 1/d = 0.2/3.5 = 0.057, hence roughly 6% volume. 
This would explain why it is kinda inaudible at the door. Now what 
values would you say are required to be used in OpenAL to make this 
sound work? From the RMS value I would say the volume would need to be 
scaled by 4.89 but OpenAL clamps this. If I use the attenuation rule 1/d 
with 1=4.89/d then d=4.89 . Reference distance = 4.89?

Am 21.05.22 um 05:05 schrieb Chris Robinson:
> On Friday, May 20, 2022 5:40:23 AM PDT Roland Plüss wrote:
>> That does not sound very usable. I've created my game engine to be
>> predictable to avoid trial-and-error. I'm also using CPU ray-tracing to
>> do a form of aurealization. Messing with roll-off and reference-distance
>> makes this difficult.
>>
>> Let's get back to the conversation example. When a person is standing
>> across the room then I can not set the volume to 4 or more to make it
>> audible. This would mean the person speaks as loud as a car engine or
>> something similar. This also means whenever a person moves you have to
>> adjust the gain to make it louder when further away.
>>
>> There has to be a sane way to set this value in a physically plausible way.
> It depends on the volume of the sound itself. You can't just take a random
> audio file, apply a generic reference distance and gain, and expect it to
> always sound correct. The only way you could get away with a generic reference
> distance and gain on sources is if the sound itself is authored at a proper
> volume. So if the sound of a person speaking is too quiet with the reference
> distance and gain you set, you need to alter the sound itself to be louder.
>
> Although that can run into issues with resolution/bit-depth since some sounds
> need to be loud but not clip when stored, while others need to be much quieter
> relative to it, which reduces the available dynamic range. For example, having
> the sound of an airplane compared to a footstep on grass/dirt, if you want the
> airplane sound to be heard from far away while not clipping, you would have
> trouble making the footstep sound quiet enough to use the same reference
> distance and gain.
>
> At best, you could probably get away with using a particular reference
> distance and gain for particular types of sound (e.g. voices use one reference
> distance and gain, cars use another, planes use another, etc), then balance
> the sound file given the sound type. As long as a given type/category of sound
> should be roughly at the same volume.
>
> In any case, though, you need to know what kind of sound you're dealing with
> to set a proper reference distance and gain for what the sound is. If you
> don't know what the sound is, OpenAL can't automatically make it sound right.
>
>
> _______________________________________________
> openal mailing list
> openal at openal.org
> http://openal.org/mailman/listinfo/openal


More information about the openal mailing list