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 include 3rd party jar in APK with make in android repo?


 I am working on the Android builtin Contact app. It can be build with "make
Contact" in the repo. Now, I want to use a 3rd party jar, and how to package
the jar into Contact.apk?

 It is easy to include external jar for Eclipse Android project, but not for
android git repo codes. I am afraid package/apps/Contact/ should
be changed to include external jar, how to do it?

-- leo


2. Camangi web station butut:-)

Setelah smartphone, android diharapkan running di tablet, layar besar, cepat, 
loading mudah.
Saya berpikir untuk punya sebuah tablet android, untuk baca majalah, comic,  
nonton dan web browser.
Salah satu produk release awal adalah camangi, but review dr gizmodo , mending 
dibuang katanya :-)

Lucky Sebastian
@K-9 android

Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to

To request to subscribe to this group:


3. How to refresh view after chaging Visible?

4. FAT32 FS Code

5. MapView Overlays Containing Widgets/View

6. How can i stop a thread in a Activity?

7. Eclipse/Android/Mac OS x problem with HelloAndroid