title: Background looping Mediaplayer
body: <p>I am working on an application which loops sounds in background but when file completes and starts again it have some delay user can notice there is some gap in looping</p>
  
  <p>I have tried the .ogg format files but still have issue</p>
  
  <p>i am using this code to play and loop sounds</p>
  
  <pre><code>player = MediaPlayer.create(getApplicationContext(), getResources().getIdentifier("raw/" + file, "raw", getPackageName()));
  player.start();                                 
  player.setLooping(true);
  </code></pre>
  
  <p>I sused .ogg format files as answered here</p>
  
  <p>File link is here</p>
  
  <p><a href="http://rpg.hamsterrepublic.com/wiki-images/b/bc/Rain2.ogg" rel="nofollow noreferrer">Link to ogg file</a></p>
  
  <p><a href="https://stackoverflow.com/questions/17971458/soundpool-not-looping-in-android-4-3">Soundpool not looping in android 4.3</a></p>