Thanks for the info about the Java MediaCodec.
I don't want to use Java for decoding but I managed to get the OpenSL decoder to work.
However AMR/3GP files are not supported, 3GP files with AAC audio works but not AMR.
This page
states "The table below describes the media format support built into the Android platform"
and the table includes the AMR decoder.
I've tested with four Android devices but no luck. It seems AMR isn't supported
but a confirmation or an explanation from someone with better knowledge would be great.
I also found out what seems to be a bug?
I build my JNI stuff both for arm and Intel, when decoding mono mp3 files on the
Intel platform (Samsung Galaxy 3 10.1), the files play back at half speed and an
octave down, seems as the decoder return a duplicate of every sample (I didn't
check that but that's what it sound like). This device uses Android 4.2.2 so
first I thought that might be the cause? Stereo mp3 files work fine as does other formats, both mono and stereo files.
I then tested with three arm devices: Amazon Kindle - Android 4.0.x, Google
Nexus 4 and 10 both running Android 4.4.2. Works perfect. So this seems to be an
Intel issue. I don't know where to report bugs so this is the report.