I am making a game in which the user has to pick up items while passing through a level. I play a sound using a SoundPool
object every time the user picks up an item. The sound seems to be causing a slight bit of lag when it is triggered. The thing is, this only occurs on my LG G2, and not my 3 year old asus tablet with significantly less powerful hardware. I'm playing the sounds on the same thread that the game is running in. The following code is how I set up and call my SoundPool objects.
Set up:
sp = new SoundPool(5, AudioManager.STREAM_MUSIC, 0);
gemSound = sp.load(this, R.raw.gemget, 1);
Calling:
sp.play(gemSound, .4f, .4f, 0, 0, 1);
So my question is: Is there a way to make this lag disappear? I'm pretty confused as to what the problem is, since my old, less powerful hardware runs the game butter smooth, and my brand new, powerful hardware is having the issue. Any help is appreciated. Thanks.
EDIT: the sound file is in .mp3 format.