• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Problems with SoundPool

Thest

Lurker
I have the following code
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?
 
Back
Top Bottom