title: Play sound precisely every one second
body: <p>I am learning to code for Android and I have a problem with... maybe performance?
  I want to play very short sound every second. I have created a CountDownTimer (with tick interval 20ms so very accurate) and putted there in onTick to play it. But the sound is played not precisely after one second and I can hear this - this is the problem...</p>
  
  <p>fragment of my code:</p>
  
  <pre><code>private class ExerciseCountDownTimer extends CountDownTimer
  {
  ...
  public void onTick(long millisUntilFinished)
  {
      ...
      if(/*this is a next second not just a tick*/)
          playSound(R.raw.quick_rest, true);
  }
  }
  
  private void playSound(int resId, boolean releaseAfter)
  {
      if (currentMediaPlayerRes != resId || mediaPlayer == null)
      {
          if (mediaPlayer != null)
          {
              if (mediaPlayer.isPlaying())
                  mediaPlayer.stop();
              mediaPlayer.reset();
              mediaPlayer.release();
          }
          currentMediaPlayerRes = resId;
          mediaPlayer = MediaPlayer.create(this, resId);
          if (releaseAfter)
          {
              mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener()
              {
                  @Override
                  public void onCompletion(MediaPlayer mp)
                  {
                      mediaPlayer.release();
                      mediaPlayer = null;
                  }
              });
          }
      }
  
      mediaPlayer.start();
  }
  </code></pre>
  
  <p>Is it possible to have counter like this?</p>