Hi Chris,
The descriptions of AL_MIN_GAIN and AL_MAX_GAIN don't seem to mention the
type of Source (2D vs 3D) so the Creative implementations support volume
clamping on non-3D Sources. i.e. for a multi-channel source
gain = min(source gain, maxgain)
gain = max(gain, mingain)
gain *= listener gain
Dan
Creative Labs (UK) Ltd.
Notice
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying or distribution of the message, or
any action taken by you in reliance on it, is prohibited and may be
unlawful. If you have received this message in error, please delete it
and contact the sender immediately. Thank you.
Creative Labs UK Ltd company number 2658256 registered in England and Wales
at Belmont Road, Belmont Place, Maidenhead, Berkshire, SL6 6TB
Chris Robinson
<chris.kcat@gmail
.com> To
Sent by: Lucas Beyer <
pompei2@...>
openal-devel-boun cc
ces@... openal-devel@...
eative.com m
Subject
[Openal-devel] Re: OpenAL-soft
02/08/2009 11:43 problems with stereo music
PM
On Sunday 08 February 2009 3:19:09 pm you wrote:
> > Ah, from what I see here, you're setting this:
> > alSourcef(source, AL_GAIN, (ALfloat) 100.0);
> >
> > The value would be 1.0 for normal volume. 100.0 would be 100x normal
> > volume,
> > and causes massive clipping. If I set the gain to 1.0, it plays fine.
> > Forcing
> > the isMono path works because it clamps the source's gain between
> > AL_MIN_GAIN
> > and AL_MAX_GAIN (which default to 0 and 1 respectively) for
> > attenuated/mono sources, but it doesn't for the multi-channel path. Try
> > to set the gain to 1.0
> > instead of 100.0 and see if that fixes it.
>
> D'oh ! At first quick test it seems to work! Thank you very much, we were
> looking at a completely wrong place, for so long :-o
>
> I don't know anything about sound mixing, but shouldn't you clamp the
gain
> in stereo too? (or do something else to avoid such problems). I say this
> because it looks like other game developers had such an issue too.
That's a good question. I'll CC this to openal-devel because I'm not sure.
The OpenAL spec only mentions clamping the source gain to AL_MIN_GAIN and
AL_MAX_GAIN after attenuation of mono sources, and the original code I
started
with doesn't clamp multichannel sources. However, it does make sense to
clamp
the source gain for multichannel sources. I'd like to hear what the
intended
behavior is supposed to be though, before committing any changes.
> Anyway, thanks again for your precious help (and lib)!
Not a problem. Glad you got it sorted out. :)
_______________________________________________
Openal-devel mailing list
Openal-devel@...
http://opensource.creative.com/mailman/listinfo/openal-develForwardSourceID:NT00069186
_______________________________________________
Openal-devel mailing list
Openal-devel@...
http://opensource.creative.com/mailman/listinfo/openal-devel