On Tue, May 26, 2009 at 4:40 AM, Moons <[email protected]> wrote:

>
> So what you say is that's it's impossible to have a FileDescriptor
> pointing to my raw sound ...


Well, yes and no. Read again what I said.

But when you call MediaPlayer.create() it does kinda localize the
> sound in the APK.
> I'm sure there must be a way to load a sound located in the APK :)


Of course there is. You've even used one of those methods already:
MediaPlayer.create(int resourceID).
To do that with a filedescriptor instead of a resource ID, you'd use:
MediaPlayer.setDataSource(FileDescriptor file_descriptor_of_apk_file, long
offset_within_apk_file, long length_of_data_within_apk_file).
All three arguments can be obtained from the AssetFileDescriptor object that
you get from openRawResourceFd()

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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