4

I have my android app where data is packed using FileWrap. The thing is I want to wrap the mp3 data into the android file and play from that memory. I have checked the nativeaudio example in NDK which shows how to play MP3 as an asset or as a filesystem file, but it does not show how I can play an MP3 that is embedded into memory.

Please help. Thanks.

madan kandula
  • 460
  • 5
  • 22

1 Answers1

0

I don't think that is possible... yet.

AFAIK android opensl only supports MP3 decode & playback from a stream...

I have not seen the latest ndk release (r9b) yet, but if the opensl example app does not support in-memory, on-the-fly decoding, I doubt it is available.

Perhaps having a look here may clear things up: https://groups.google.com/forum/#!searchin/android-ndk/opensl|sort:date/android-ndk/cMHlkyQkFU0/vMkyO2201yYJ

Or you could just dump your MP3 files in the "assets" folder and play them using the AAssetManager as per usual.

Erik
  • 804
  • 1
  • 8
  • 18