I have the following code
But this is not working. No ogg file is playing.. If I use MediaPlayer if works
Can anyone see what Im doing wrong?
Code:
public SoundPool sounds;
public HashMap<Integer, Integer> soundmap = new HashMap<Integer, Integer>();
static final public int BEACH=1;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//....
sounds = new SoundPool(3,AudioManager.STREAM_MUSIC,0);
soundmap.put(BEACH,sounds.load(this, R.raw.jungle_bgloop, 1));
sounds.play(soundmap.get(BEACH),0.8F,0.8F,1,-1, 1);
But this is not working. No ogg file is playing.. If I use MediaPlayer if works
Code:
MediaPlayer mp = MediaPlayer.create(this, R.raw.jungle_bgloop);
mp.start();
Can anyone see what Im doing wrong?