Coder Social home page Coder Social logo

extaudiofileconverter's Introduction

An iOS project to convert audio from any format to any format.

ExtAudioConverter is an implementation of the afconvert command on OS X,
so this readme file uses some hints of afconvert help documentation. For example, LEI16 means little-endian signed int with 16 bit depth.

How to use:

  1. Link Binary with Library "AudioToolbox.framework";

  2. Add "ExtAudioConverter.h" and "ExtAudioConverter.m" to your project;

  3. Test:

ExtAudioConverter* converter = [[ExtAudioConverter alloc] init];
converter.inputFile =  @"/Users/lixing/Desktop/input.caf";
converter.outputFile = @"/Users/lixing/Desktop/output.wav";
[converter convert];

The following parameters are optional:

Set the sample rate:

converter.outputSampleRate = 44100;

Set channel count:

converter.outputNumberChannels = 2;

Set bit depth:

converter.outputBitDepth = BitDepth_16;

Set data format:

converter.outputFormatID = kAudioFormatLinearPCM;

Set file format:

converter.outputFileType = kAudioFileWAVEType;

Some parameter combinations is impossible, like mp3 file format together with wav data format.
The valid file type/data format pair is described on the Apple documentation
https://developer.apple.com/library/ios/documentation/MusicAudio/Conceptual/CoreAudioOverview/SupportedAudioFormatsMacOSX/SupportedAudioFormatsMacOSX.html

For mp3 format conversion

Apple doesn't include the MP3 encode algorithm in its APIs, but include the decode algorithm.
So we can now convert from mp3 file to other formats, but can't convert to mp3 format.
We will use other open source mp3 codec, like lame, to convert to mp3 format.
We have now supported conversion to mp3 format, using the famous lame mp3 codec.

If you have any questions, please commit an issue, or mail me:[email protected].

extaudiofileconverter's People

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.