I found a class called SoundPool that appears to be suited for exactly what I'm trying to do however the documentation is very weak - http://code.google.com/android/referenc ... dPool.html
Has anyone used this with success? If so, could I see a little code snippet?
I tried this:
Using java Syntax Highlighting
- private void initSounds() {
- // 4 streams
- // stream type 3 is music
- soundPool = new SoundPool(4, 3, 100);
- int explosionSound = soundPool.load(getContext(), R.raw.explosion, 1);
- soundPool.play(explosionSound, 100, 100, 1, 0, 1);
- }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
but it didn't appear to do anything. I didn't get errors but I also heard no sound. Perhaps I need to configure something for the emulator to work like that?




