I'm developing a game, when I wanna load some of sounds, I got this error ” soundpool unable to load sample (null) " (I see it in logcat and It doesn't throw any exceptions).
I googled it but can't find anything.
Any suggestion?thanks for your attention.
This is my code:
SoundPool soundPool = new SoundPool(10, AudioManager.STREAM_MUSIC, 0);
ObjSound = soundPool.load(context, R.raw.objs, 1);
The problem was because of bad initialize and loading in memory. I'm was do that piece of code for all of my object ( I have 5 object with 9 same sound , so soundPool.load was repeated 45 times! ) although these sounds ain't high size and shouldn't get memory problem.
Still I don't know the source of problem.
But finally I fix this problem by define soundPool and all of ObjSound static,and init and load them only once in the start of game and use them over the project