scheduleRandomSound method

void scheduleRandomSound(
  1. RandomSound sound
)

Schedule a random sound to play.

Implementation

void scheduleRandomSound(final RandomSound sound) {
  final int offset;
  if (sound.minInterval == sound.maxInterval) {
    offset = 0;
  } else {
    offset = random.nextInt(sound.maxInterval - sound.minInterval);
  }
  getRandomSoundNextPlay(sound).runAfter = sound.minInterval + offset;
}