I'm using OpenAL via the LWJGL bindings http://www.lwjgl.org/javadoc/. I need to know the maximum possible gain for my volume setting function. Unfortunately AL10.alGetSourcef(sources.get(0), AL10.AL_MAX_GAIN) always returns 0F, whether or not an AL instance is open. If I set the gain with alSourcef to some other value, that becomes the new AL_MAX_GAIN. So how can I find the actual maximum gain? Without it I don' see how I can hook up an audio volume slider to the gain value.
+1
A:
AL_MAX_GAIN is not maximum gain of your sound system, its the value that you set. for example if you set max gain to 0.75 then you play a source with gain 1.0, the source will be played at 0.75 gain since you limit the maximum gain.
openAL concept of gain is relative in range of minimum 0.0 and maximum 1.0, its depend on your sound system : O/S, sound card, amplifier, etc to map how dB to apply to 1.0 value.
uray
2010-03-06 16:56:04