Play audio file from the assets directory

player.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength()); Your version would work if you had only one file in the assets directory. The asset directory contents are not actually ‘real files’ on disk. All of them are put together one after another. So, if you do not specify where to start and how many bytes to read, the player will read up … Read more

Android MediaPlayer works fine in Custom audio Streaming application up to Android 2.1 but not in higher versions

The problem is that content type “audio/aacp” streaming is not supported directly. Some decoding libraries can be used to play “aacp”, please see the solution below: Freeware Advanced Audio (AAC) Decoder for Android How to use this library? Consider legal issues while using it. [T]he project http://code.google.com/p/aacplayer-android/ is licensed under GPL, so you can create … Read more