isn't that what I am doing with the above code? Thread t = new
Thread() { public void run() { ...
thanks
On Oct 5, 8:02 am, Simon Platten <[email protected]> wrote:
> Hi,
>
> Why don't you play your audio in one thread and play your animation in
> another thread?
>
> The way you have it now, its single synchronous process.
>
> Regards,
> Simon
>
>
>
> On Tue, Oct 5, 2010 at 3:50 PM, ArcDroid <[email protected]> wrote:
> > 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]<android-developers%2Bunsubs
> > [email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
--
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