Cytopia
Cytopia copied to clipboard
Separate music and sound FX volume
Right now setMusicVolume changes all sound volume, not just music, and setSoundEffectsVolume does nothing. It's been like this for a while, I just wanted to create an issue so it wasn't forgotten about.
The relevant bit from AudioMixer.cxx
.
void AudioMixer::setMusicVolume(float volume)
{
// alSourcef(currentSourceID, AL_GAIN, newVolume);
// this would set the volume, but idk how to get the "currentSourceID"
// for now set the volume for everything.
alListenerf(AL_GAIN, volume);
// update the settings accordingly
Settings::instance().musicVolume = volume;
}
void AudioMixer::setSoundEffectVolume(float volume)
{
// find out how to set those volumes seperately
//alListenerf(AL_GAIN, volume);
// for now, just set the settings value, even if it doesnt do anything
Settings::instance().soundEffectsVolume = volume;
}
Might have to generate more sources in Soundtrack.cxx
, because right now only one is generated, so I think we might need one source for music and one for SFX.