The code:
//this is all contained in my MainActivity.

private SoundPool soundPool;
   private HashMap<Integer, Integer> soundPoolMap;
   public static final int SOUND_CANNON = 1;

   private void initSounds() {

       soundPool = new SoundPool(5, AudioManager.STREAM_MUSIC, 100);
       soundPoolMap = new HashMap<Integer, Integer>();

       try {

       soundPoolMap.put(SOUND_CANNON, soundPool.load(this,
R.raw.cannon, 1) );

       } catch(Exception e) {

           // error HERE is 'Resource Not Found'
           String s = new String(e.getMessage());

       }

       }

The Problem:

soundPool.load fails indicating that the RESOURCE CANNOT BE FOUND.

The ogg files "cannon" is in my res/raw folder (I am using NetBeans
with the Android 2.x Emulator, BTW)

I changed the APK extension to ZIP and unzipped it to find that the
res/raw folder and its sound files are all there.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to