mediaPlayer.setDataSource(fd) cause IOException: Prepare failed.: status=0x1

by Marco Nelissen » Fri, 07 Aug 2009 01:53:49 GMT

Sponsored Links

You need to use the version of setDataSource() that takes a FileDescriptor,
offset, and length.

Because setDataSource() doesn't parse the file, so the player engine is only
finding out that it can't play your apk file after you call prepare().

And why on earth is the same resource happily played one way but not

There is no design flaw. The issue is that you were only using the
FileDescriptor that you obtained from the AssetFileDescriptor that
openRawResource() returns. That file descriptor is for the entire apk file,
whereas you only want to play a specific part of that apk file.

Should I look in the  MediaPlayer.create code to see how they get


Other Threads

1. sending scancode values from linuxapplication (using sendevent)

Hi all,

I want to send scan code values from user space to Android screen. can
we send this with the sendevent command?
Instead  from keypad.

when tried "sendevent device type code value" getevent is able to read
these values, but iam unable to see this
scancode value on screen.

To see the sendevent ->scancode value on screen, what conditions need
to take care in App layer.

Is there any Document r link, which describes how I/P driver sends
events to Android screen.

can any one tell me the type and code values in sendevent. "sendevent
device type code value"

Thanks in advance,


2. Loop audio from mic to earpiece?

Hi all,

I was wondering is it possible with Android to record from the mic and
play the sound back out the earpiece with just a 1 second delay?

I have seen the tutorials and can currently record from the mike and
save a 3gp file to the sd card.

However is it posssible to record and say stream the audio straight to
the ear piece with just a 1 - 2 second delay?

If so how would I go about doing this?

Would I need to record from the mic and save it to a file and then
repaly to the ear piece? and continually do this?

Or would it be possible to record from the mic and stream it directly
to the ear piece with just a slight delay?

Any help, info or directions to tutorials would be greatly

Thanks in advance

3. How can target activity get the request code in startActiivtyForResult()?

4. in AssetManager.readAsset (Android BUG)

5. Android Installation

6. 7.7 Million Android Handsets Sold in 2009

7. Penjualan Ponsel Android Acer Naik Drastis