An opencore amr codec JNI wrapper with explanation
- opencore is the multimedia framework of android, which is a originallly contributed by PacketVideo.
- AMR is abbreviation for Adaptive Multi-Rate audio codec, which is an audio compression format optimized for speech coding.
- opencore-AMR is extracted from opencore as an codec for amr<->pcm encode/decode
- opencore-AMR-Android is a wrapper for handy usage. You can usage wrapped api in Android Application without any troubles of writing c++ wrapper or ndk mk file.
- Down load the package.
- Put jni/libs/src folder to your Android Studio or ADT application project.
- Call api like this:
AmrEncoder.init(0);
int mode = AmrEncoder.Mode.MR122.ordinal();
short[] in;//short array read from AudioRecorder
byte[] out = new byte[in.length];
int byteEncoded = AmrEncoder.encode(mode, in, out);
AmrEncoder.exit();
there you go.