So it has been a while since I have used SFML, but my build folder does say I am on 2.5.1.
I am trying to have a mute button, but am getting a strange artifact. It seems volumes will only change when the sound is actually playing.
So if volume is 100, set it to 0, it appears the next time the sound is played it will for a split second be at 100 then switch to 0, but it isn't before the sound starts so there is an audible blip. If that sound is played again (with no volume changes) this does not repeat. This happens individually for each effect, so it isn't one blip, but a blip for the first time each effect is played after change.
Sleep(1000);
sf::Listener::setGlobalVolume(100.0f);
effect[2].play();
Sleep(1000);
sf::Listener::setGlobalVolume(0.0f);
effect[2].play();
Sleep(1000);
effect[2].play();
Results in first play fine, second blip, third silent.
Sleep(1000);
sf::Listener::setGlobalVolume(100.0f);
effect[2].play();
Sleep(1000);
sf::Listener::setGlobalVolume(0.0f);
Sleep(1000);
effect[2].play();
Sleep(1000);
effect[2].play();
Results are the same as above, so a pause before playing doesn't help.
The same happens if I set the volume of individual effects rather than the listener.
Am I doing this incorrectly? Something with my system? With openal32? Seems unlikely that this would not already be in the forums that I could find if it wasn't something on my machine.
*EDIT*
I've been playing around a bunch, and gotten more clues. So I have some very short sounds, and so it is clear the volume change is only being applied while playing. Some are short enough where it takes 10 or 20 plays of the sound, progressively softer, for the volume to go to 0.
Doesn't seem like it should work this way.