When an Android device does not support a mandatory audio-encoder, you get: (X=numeric index of the encoder)
E/MediaProfiles(4048): The given audio encoder X is not found A/AudioSource(4048): frameworks/base/media/libstagefright/AudioSource.cpp:58 CHECK(channels == 1 || channels == 2) failed. A/libc(4048): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1) In native code. No Exception to react to. App is just force closed.
Is there any way to query an Android >3.x device if AAC AMR-NB and AMR-WB are actually supported? Documentation ( http://developer.android.com/guide/appendix/media-formats.html ) says that these are core media formats and thus always supported. Some actual and common phones out there (of major brands) don't.
MediaCodec.createByCodecName(String name)
and
Get supported Codec for Android device
only works with API16=Android 4.1 but the devices in question are 4.0.x .
It also does not list AMR-NB and AAC.
On your Android device, the media profiles/capabilities are stored in a config file called media_profiles.xml(on ICS/4.0).
Normally, this file is located in /etc folder on the device.
So what you could do is
Examine the AudioEncoderCap properties. There will be multiple entries for each capbility that is advertised. for ex:
AudioEncoderCap name="aac" enabled="true" minBitRate="8192" maxBitRate="96000" minSampleRate="8000" maxSampleRate="16000" minChannels="1" maxChannels="1"
If the 'enabled' flag is set to "true" as above, then that capability should be supported by the device. If it is not supported, the 'enabled' flag will be set to "false".
AFAIK, the media codecs framework introduced on jb (4.1) read this/similar config file to expose the device capabilities to the application layer.
Hope this helps.
Thanks!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With