开发者

finding maximum gain in OpenAL

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 wi开发者_如何学运维th 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜