I've been googling and searching the groups for answers and haven't
been able to find anything concrete.  I have several questions
regarding the use of MediaPlayer if somebody can help me out:

1. I need to package an audio resource with my application, which I
have done in /res/raw.  However, it appears that I must use
MediaPlayer.create() to use a resource ID rather than
MediaPlayer.setDataSource().  I found some references to creating a
URI to raw via "android:resource://package/raw/name" and
"android:resource//package/" + resourceId.   However, both of these
tries resulted in IOExceptions during setDataSource.  I'm assuming due
to a bad URI.  Is it possible to get a valid URI in SDK 1.0 that will
point to a raw resource?

2. I'm writing an app that does some tracking and will typically go
hand in hand with the music player running.  Part of my app will, at
times, need to play sound on top of the running audio stream.  Is
there any way for my app to get ahold of and temporarily pause the
music stream so that the user will be able to clearly hear my audio?
Is this prevented because it's considered 'bad behavior'?  (I hope not
because in my case its actually good and desirable behavior)

3. I see that I can set the audio stream but is there any
documentation/discussion/details on what the various streams are, how
they are used, and how they interact with one another?   For example,
as mentioned above I want to be able to pause/override/interrupt a
music playing stream with my notification but I would NOT want to have
my notification play if they are on an active phone call.   Also, is
there any doc/discussion/detail on which methods can be invoked on the
mediaplayer at what times?  As I experiment I seem to get a lot of
'invalid media state' errors when I try things with very little
indication as to what state it is in and how I get it from the bad
state to an acceptable state for the method in question.

Thanks for any assistance.  I've been researching for a couple of days
but all the information I can find is very sparse or appears to be
things that were valid in early SDKs but may not be any longer.

Thanks,

Greg


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to