MediaPlayer blocked(AudioFlinger write blocked) while playing animation

by quill » Fri, 20 May 2011 15:19:15 GMT

Sponsored Links
 Hi all,

I have a thread to play audio and animation together. It's a frame
animation. The drawable resources are in sdcard. When I play the
animation, I use a handler to send message to refresh images one by
Here's my code:
final Handler handle = new Handler(){
     public void handleMessage(Message msg){
          BitmapDrawable bmpDraw = new BitmapDrawable("sdcard/
          if(msg.what < fileNames.length-1){
MediaPlayer mp = new MediaPlayer();
...//play audio

The animation performs fine, but the audio will be stopped when it
begins to play for seconds. From logcat I see AudioFlinger: write
blocked for 89 msec...

I don't use AnimationDrawable because there are many images in sdcard,
when I use addFrame(AnimationDrawable.createFromPath(...)) I got an
OutOfMemory Exception.

Am I doing the right thing? Can anyone help me?


Other Threads

1. How to draw a circle of Given Radius on Google Maps


Google Maps provide a GPolygon class which returns the crilce of a
given radius; by using addOverlay method of GMap2 this circle can be
draw on Map.

In android we only have MapView class. How can I access addOverlay and
use GPolygon class in Anroid.

I want to implement the same functionarly provided by
but in Android.



2. Blur an image

I have a camera application that captures an image and saves it in the
sdcard.I want to blur the image now.I need to design a simple blur
filter,I have no idea how I can do it in android.I can not find any
examples anywhere.Can someone tell me the basic steps to blur an image
in android?

3. How to retrieve undelivered messages from handler when process is being killed

4. Having Problem in Getting Webservice Soap Object response casting to userdefined typ

5. Access Context from a different Package

6. Rotate an image in android

7. Access Context from a different Package : getApplication returns null