blindfold wrote:
[...]
> However, in android.media.MediaPlayer I only find create() for URIs
> and
> for resources, and not for ByteArrayInputStream!? Does that mean that
> Android cannot be used for in-memory audio synthesis? Or do I overlook
> some alternative way of programming in Android?

MediaPlayer.create() is just a convenience function --- you ought to be
able to do:

FileDescriptor fd = something.getFD();
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(fd, "audio/wav"); // FIXME check MIME type!

Unfortunately the documentation (which is unevenly indexed) doesn't
mention getFD() on anything other than file streams. There *may* be a
way somewhere of being able to create a Unix pipe, opening it, and
giving MediaPlayer a FileDescriptor that way, but I wouldn't know how.

I'm currently writing an app using MediaPlayer extensively, and my
experiences indicate that it's extremely touchy --- large chunks of it
don't work, error reporting is poor, it's missing key bits of
functionality (such as synthesised audio!) and it's very touchy. If you
do anything the slightest bit wrong it has a tendency to crash your app.

You might want to wait for the next SDK, or mug a top-50 winner...

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "I have always wished for my computer to be as easy to use as my
│ telephone; my wish has come true because I can no longer figure out
│ how to use my telephone." --- Bjarne Stroustrup

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to