Skip to content

zxc524580210/opencore-amr-android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencore-amr-android

An opencore amr codec JNI wrapper with explanation, And one solution for packaging amr audio files.

QQ tribe for help: 453503476

Background

  • 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

What Is This

  • 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.
  • demo project offer a solution for packaging amr audio files, in elegant code structure.

Quick Start Up

  • Down load the library.
  • 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, recommend length 160
    byte[] out = new byte[in.length];
    int byteEncoded = AmrEncoder.encode(mode, in, out);
    AmrEncoder.exit();

there you go.

Packaging amr audio to file system

record->encode->package amr file->upload(not implemented)

Audio steam is packaged to file in slices, the slice last a few seconds(customizable). This policy is suitable for this scenario: client is under unstable mobile network, client records amr file, sends slice by slice, server re-assembles the slices.

If you are interested in this solution, please refer to demo

FAQ

  1. The second parameter of AmrEncoder.encode accept an array, it's recommended to 160 in short, or 320 in byte.

About

opencore amr codec for android

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 76.8%
  • C 22.3%
  • Other 0.9%