如何调整OpenAL声音库中声音的音量?
答案 0 :(得分:12)
float newVolume = 0.4f;
alSourcef(currentSourceID, AL_GAIN, newVolume);
答案 1 :(得分:1)
void Listener::setVolume(float v)
{
Assert::isTrue(0 <= v && v <= 1);
alListenerf(AL_GAIN, v);
}
float Listener::getVolume()
{
ALfloat v;
alGetListenerf(AL_GAIN, &v);
return v;
}