Ok, I just ran into this during my effort to improve the AudioSystem in JME.
public void unmute() {
setVolume(volume);
}
public void mute() {
if (enabled)
setVolume(0.0f);
}
public float getVolume() {
return volume;
}
public void setVolume(float volume) {
this.volume = volume < 0.0f ? 0.0f : volume > 1.0f ? 1.0f : volume;
player.setVolume(this.volume);
}
Am I the only one who would think that:
track.mute();
// no sound now....
track.unmute();
// The sound is back up...
Would be the case? Well it is not, since setVolume(0.0f) will set track.volume to 0.0f making a call to unmute() not work as expected.
Is anyone interested in mute() unmute() methods? Could they not just use setVolume(0.0f) and setVolume(1.0f) if that is what mute/unmute does?