<commit_before>opencore-amr-android
====================

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

### 中文文档请移步[README_CN](README_CN.md)
## QQ tribe for help: 453503476

## Background
- [opencore][1] is the multimedia framework of android, which is a originallly contributed by PacketVideo.
- [AMR][2] is abbreviation for Adaptive Multi-Rate audio codec, which is an audio compression format optimized for speech coding.
- [opencore-AMR][3] is extracted from opencore as an codec for amr<->pcm encode/decode

## What Is This
- Opencore-amr-dndroid 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.

## Setup
- Android Studio

  1. Add jcenter as your repository in project's build.gradle:
  ```gradle
  allprojects {
        repositories {
            jcenter()//this is the default setting
        }
      }
  ```
  2. Add dependency in your module's build.gradle:
  ```gradle
  dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.hikvh:opencore-amr-android:1.0.0'//this is the lib
  }
  ```

  OR: Copy the content if [library](library/) to your module, as follows:

  ![Integration](screenshot/android_studio_integration.png)

- ADT(Eclipse)
  1. Copy the content if [library](library/) to your project:
  > Copy content of libs and src to the corresponding folder

## Quick Start Up
- Call api like this:

``` java
    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);<commit_msg>minus fix<commit_after>opencore-amr-android
====================

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

### 中文文档请移步[README_CN](README_CN.md)
## QQ tribe for help: 453503476

## Background
- [opencore][1] is the multimedia framework of android, which is a originallly contributed by PacketVideo.
- [AMR][2] is abbreviation for Adaptive Multi-Rate audio codec, which is an audio compression format optimized for speech coding.
- [opencore-AMR][3] is extracted from opencore as an codec for amr<->pcm encode/decode

## What Is This
- Opencore-amr-dndroid 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.

## Setup
- Android Studio

  1. Add jcenter as your repository in project's build.gradle:
  ```gradle
  allprojects {
        repositories {
            jcenter()//this is the default setting
        }
      }
  ```
  2. Add dependency in your module's build.gradle:
  ```gradle
  dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.hikvh:opencore-amr-android:1.0.0'//this is the lib
  }
  ```

  OR: Copy the content if [library](library/) to your module, as follows:

  ![Integration](screenshot/android_studio_integration.png)

- ADT(Eclipse)
  Copy the content if [library](library/) to your project:
  > Copy content of libs and src to the corresponding folder

## Quick Start Up
- Call api like this:

``` java
    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);
{'fraction_non_alphanumeric': 0.10690121786197564, 'fraction_numerical': 0.013261163734776725, 'mean_word_length': 3.678481012658228, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '273462', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1093, 'n_words': 421}