[Openal-devel] Attenuation clamped to 1.0
Chris Robinson
chris.kcat at gmail.com
Thu Jun 28 02:58:55 PDT 2007
On Thursday 28 June 2007 02:19:30 am you wrote:
> Hi Chris,
>
> thanks for you quick answer! I don't know why I overlooked the fact that
> the spec says AL_MAX_GAIN must be in [0;1] (although this limit does not
> seem to be enforced currently). It also mentions AL_REFERENCE_DISTANCE
> as a possible minimum distance, making the clipping to 1.0 valid (but
> unnecessary as the clipping to AL_MAX_GAIN is still going to happen).
>
> IMHO gain clipping should be the user's responsibility entirely and
> there shouldn't be any limit besides AL_MAX_GAIN. If the user whishes to
> make some non-normalized sample a little bit louder, he should be
> allowed to do so. Besides, in some circumstances, a small amount of
> crackling noise may be toleratable.
I think the danger of sample wrapping is enough to warrant implicitly clamping
the effective per-source gain to 1.0. Though I can understand wanting to make
the volume louder for quiet samples, I think it'd be too easy for someone to
accidently go over, and then start complaining about clicking and crackling..
especially with OpenAL being cross-platform where other platforms or drivers
may clamp, or not wrap for other reasons.
Alternatively, the SI could switch to use 8.24 fixed point sample data, which
would give some nice overflow protection, or 32-bit floating point data. I'd
probably prefer the latter since it'd make supporting 32-bit float input a
no-brainer and keep the int<->float conversions to a minimum.
More information about the Openal-devel
mailing list