opencore-amr-android


Source link: https://github.com/kevinho/opencore-amr-android

opencore-amr-android

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

??????? README_CN

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

Setup

Android Studio

  • Add jcenter as your repository in project's build.gradle:

    allprojects {
    
     repositories {
    
      jcenter()//this is the default setting
    
     
    }
    
      
    }
     
  • Add dependency in your module's build.gradle:

    dependencies {
    
     compile fileTree(dir: 'libs', include: ['*.jar'])
    
     compile 'io.kvh:amr:1.1.1'//this is the lib 
    }
     

    OR: Copy the content if Codec/amr to your module, as follows:

ADT(Eclipse)

Copy the content if Codec/amr to your project:

Copy content of libs and src to the corresponding folder

Quick Start Up

  • encode
AmrEncoder.init(0);
  int mode = AmrEncoder.Mode.MR122.ordinal();
 short[] in = new short[160];//short array read from AudioRecorder, length 160 byte[] out = new byte[32];//output amr frame, length 32 int byteEncoded = AmrEncoder.encode(mode, in, out);
  AmrEncoder.exit();

Arm-2-File

  • decode
long state = AmrDecoder.init();
  byte[] amrframe = new byte[32];//amr frame 32 bytes short[] pcmframs = new short[160];//pcm frame 160 shorts AmrDecoder.decode(state, amrframe, pcmframs);
  AmrDecoder.exit(state);
 

AmrFileDecoder.java

Prerequisite Knowledge

  • Amr file has 6 bytes of header "23 21 41 4D 52 0A" => "#!amr.", please remember to remove the header before decoding frames, thanks to AAccount's explaination.

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 Codec/app

Milestone

v1.2.0 April-15-2015

  • format converter for amr/wav
  • test cases

Changelog

v1.1.1 2016-04-05

  • fix decoding bug of 32bit

v1.1.0 2016-04-02

  • add prebuilds for all archs
  • rename package

FAQ

Please edit the FAQ files to help others, thanks! (?????????)

FAQ_CN

FAQ

Resources

AirMapView is a view abstraction that enables interactive maps for devices with and without Google Play Services. AirMapView is built to support multiple native map providers.

Java client for the Thumbor image service which allows you to build URIs in an expressive fashion using a fluent API.

Android Library Finder

An Android library that allows you to figure out the quality of the current user's internet connection. The connection gets classified into several "Connection Classes" that make it easy to develop against. The library does this by listening to the existing internet traffic done by your app and notifying you when the user's connection quality changes. Developers can then use this Connection Class information and adjust the application's behavior.

Android APT Plugin for Gradle. Makes sources generated by annotation processors visible in Android Studio.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes