title: Which is the best player to use for playing 1 audio sound in a loop?
body: <p>Currently I am using a mediaplayer to play one single audio file in a loop when a button is clicked( stops playing when a certain event is triggered or onstop). However, I am not sure if mediaplayer is ideal for playing 1 audio sound worth 8-10 seconds set to loop to a max of 30seconds. Is there a better and resource efficient alternative I can use? Any examples would help.</p>
  
  <p>Here's my code so far:</p>
  
  <p>MediaPlayer mp;</p>
  
  <pre><code>onCreate(savedinstance){
  ....
   mp = MediaPlayer.create(getBaseContext(), R.raw.ringbacktone);
          mp.setLooping(true);
          mp.setVolume(100, 100);
  ...
  }
  
  public void somefunction {
  ...
  case someeventhappens: 
     mp.start();
  break;
  ...}
  
  
  @Override
      public void onStop() {
          super.onStop();
      mp.stop();
  }
  
   @Override
      protected void onDestroy() {
          super.onDestroy();
          if(mp != null) {
              mp.stop();
          }
  </code></pre>
  
  <p>Any idea how I can improve this or use a better resource efficient alternative to best suit my needs of just playing a .wav file ? </p>
  
  <p>Thanks in advance!</p>