Coder Social home page Coder Social logo

cordova.phonegap.audio.encode's Introduction

PhoneGap/Cordova AudioEncode Plugin

  • Original by Lyle Pratt
  • Updated by Keenan Wyrobek and John Croucher

About this Plugin

This plugin lets you easily convert WAV audio into M4A audio. It is useful when using the Phonegap audio capture or media recording functionality. Uploading WAV files on via cellular connections is not advised. M4A encoded files are 1/4 to 1/10 the size.

Using the Plugin

The plugin creates a function at window.encodeAudio(originalSrc, success, fail) method.

  • originalSrc: (required) This is a string path to the local file to encode. This is typically the fullPath property of the entry passed to the success of a fileSystem.root.getFile call
  • success: (required) This function is called when the encoding has completed successfully. It will be called with the new m4ASource
  • fail: (required) This function is called on encode failure and will be passed a statusCode.

Example:

window.encodeAudio(pathToWavFile, success, fail);

var success = function(newM4APath) {
  // Do something with your new encoded audio (upload it?  - see notes in Xcode example)
  console.log(newM4APath);
}

var fail = function(statusCode) {
  // Why did it fail? - look in the plug in for source of error codes.
  console.log(statusCode);
}

Adding the Plugin

  cordova plugin add https://github.com/nickbarth/cordova.phonegap.audio.encode.git

LICENSE

The MIT License

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.