title: Libgdx Sound Effect is not playing Fluently or Completely issue only on Android (lagg effect on sound)
body: <p>I developed a nice game with libgdx + java, for android as target platform.
  I am almost at the end, only improving the maps is the remaining task.
  Till now I was running - debugging my game on desktop because you know libgdx is cross platform and my expectation was just right click and export for android.
  And of course I tried, then what? all of a sudden I hit the wall.
  The problem is that my sound effects are not sounding fine on android.They are working great on desktop but not nice on android. Let me analyze the case with a few questions and on examples:
  if we consider an explosion sound effect:
  a scenario; vehicle hits to an explosive I catch the contact from box2d and call play method on a explosion sound effect.
  what I expect is a normal explosion sound.
  In desktop I hear it, no problem but in android what I hear is just a very very short noisy (really short perhaps a few miliseconds) then a long silence after a while again a short noisy
  what did I try:</p>
  
  <p>I tried the recommendations from many other threads they are:</p>
  
  <ol>
  <li>I tried it in formats 44.1k hz 16 bit wav file same format ogg file 22.05 k hz wav file they all sound same.</li>
  <li>sound effect will not be too short or too long. Okay, it is fine mine is 3 seconds.</li>
  <li>I tried to re-save or arrange it with fl-studio and audacity. </li>
  </ol>
  
  <p>I tried them on s5 mini experia z1 and z3 all the same. </p>
  
  <p>mp3 files are working great when I use music class 
  but I have a lot of sound effects and music class is not for that usage so I need to solve this problem</p>
  
  <p>I tried a few other sound files different than my explosion sound effect with same conditions (I mean sound formats frequence or bit rate etc..).</p>
  
  <p>I checked if the sound is loaded completely whether not. yes it is loaded completely but sounds same and of course I am playing it after a while my game starts. With this sentence I mean I waited at least the next frame to play the sound because some guys said that it can not play in the first frame in some thread.</p>
  
  <p>if we want to see some code:
  how I load the file:</p>
  
  <p>this is called when the game just starts while the user is patiently following the progress bar in loading screen :)</p>
  
  <pre><code>private void loadSoundEffects(){
      assetMan.load("sounds/explosion.wav", Sound.class);
  }
  </code></pre>
  
  <p>then I get the sound into a global sorted map in another method after loading is complete</p>
  
  <pre><code>   soundEffects.put("explosion",assetMan.get("sounds/explosion.wav", Sound.class));
  </code></pre>
  
  <p>in my sound manager class I have such a method</p>
  
  <pre><code>public void playSingle(String name,float x ,float y){
      Sound sound=null;
      sound=soundEffects.get(name);
      long id=sound.play();
      sound.setVolume(id, getVolume(x, y));//dont worry here volume returns always 1 for texting
  }
  </code></pre>
  
  <p>when I call play method right here it returns a positive id (in case of problem it will return -1) </p>
  
  <p>For loading stuff I also tried this way:</p>
  
  <pre><code>sound=Gdx.audio.newSound(Gdx.files.internal("sounds/explosion.wav"));
  </code></pre>
  
  <p>this is a big project so I have perhaps more than 70 classes => I can not paste all of them here :)
  but I feel ready to answer any kind of how,what,where,why,when questions, ask pls..
  if you need any more code or file or something just let me know</p>
  
  <p>lets see how it sounds; I uploaded normal explosion wav file and the one I recorded from phone in this rar:</p>
  
  <p><a href="http://www.filedropper.com/soundeffects" rel="nofollow">http://www.filedropper.com/soundeffects</a></p>
  
  <p>you will hear a few sounds like tick tock really it sounds like this :)</p>
  
  <p>EDIT: adding some more info</p>
  
  <p>it is working on windows 7 my OS is win 7</p>
  
  <p>I am using latest libGDX. my IDE is eclipse. I tried it by unplugging the cable to get rid of debugger but result is same.</p>
  
  <p>for sound effect usage file size must be less than 1 mb as wiki says and my file is 688 KB</p>
  
  <p>EDIT: related with performance?</p>
  
  <p>I started to think if it is related with performance of my code. think about some other reason that causes a lag and it makes this effect on sounds but here are some values game works with 55-60 fps even some times all calculations take less than 15 ms but I hear the same sound, same with very little files like 60 KB. So, I will keep thinking about the files. if they are broken? or still a format issue? do you have a working sound effect file? or any suggestions about format? I read somewhere 96khz 16 bit ogg file I tried it as well.</p>
  
  <p>EDIT: important notice</p>
  
  <p>I played my game on mobile. I hit some explosives by car. it was sounding same then I went back to menu. I forgot my phone open. The game was running. But screen is locked automatically. It left like that perhaps 15-20 minutes. Then to try one more time I unlocked the screen and what happened? all of a sudden all explosives exploded I herd the sounds really fine and complete and menu screen was still being displayed. as a result I think I can conclude this when game pauses for enough time sound effects gets ready and can be played well. what does this mean now? sound effects didn't load from memory yet but I am trying to play? or get-ready has another meaning here? I checked if it is loaded or not with asset manager's isLoaded() method it returned true. I did this just before calling the play method on sound. should I trust this isLoaded method? or what?</p>
  
  <p>Well, guys thanks for your helps in advance.</p>
  
  <p>Sorry I kept it a little long I will keep trying and researching..</p>