How to adjust the volume of a sound in OpenAL?

openfrog picture openfrog · Sep 28, 2010 · Viewed 8.6k times · Source

How can I adjust the volume of a sound in the OpenAL sound library?

Answer

Jay picture Jay · Feb 20, 2011
float newVolume = 0.4f;
alSourcef(currentSourceID, AL_GAIN, newVolume);