Hello,
I am trying to play a sound and also show a new picture.  The pictures
are only ~1Kb in size, but it slows down the audio when I add in the
setImageResource.  Is it faster to use an array?  I have tried running
the audio in a new thread, but that doesn't seem to help.
Thanks



private Integer[] mImageIds = {
                R.drawable.gallery_photo_1,
                R.drawable.gallery_photo_2,
                R.drawable.gallery_photo_3,
                R.drawable.gallery_photo_4,
                R.drawable.gallery_photo_5,
                R.drawable.gallery_photo_6,
                R.drawable.gallery_photo_7,
                R.drawable.gallery_photo_8
        };


   private void playsound(final int i){



        Thread t = new Thread() {
                  public void run() {

                        mp = MediaPlayer.create(getBaseContext(),i);
                        mp.start();
                           mp.setOnCompletionListener(new 
OnCompletionListener() {
                                        public void onCompletion(MediaPlayer 
mp) {
                                                mp.release();

                                         view.setImageResource(R.drawable.xyz);
                                        }
                                });



                  }};
        t.start();
   }





-- 
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