« Return to Thread: Re: OpenAL-soft problems with stereo music

Re: OpenAL-soft problems with stereo music

by Chris Robinson-5 :: Rate this Message:

Reply to Author | View in Thread

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-devel

 « Return to Thread: Re: OpenAL-soft problems with stereo music