示例#1
0
 public void updateVolume(float volume) {
   if (isPlaying()) {
     float effectiveVolume = volume * _volume;
     if (effectiveVolume > 0) sound.setVolume(effectiveVolume);
     else sound.stop();
   }
 }
示例#2
0
 @Override
 public void release() {
   if (sound != null) {
     if (sound.isPlaying()) sound.stop();
     sound.release();
     sound = null;
   }
 }