Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Adobe alchemy encoder for flac audio library
branch: master

Flac Alchemy Encoder

Free Lossless Audio Codec (FLAC). This is a SWC that wraps the base functionality of the FLAC codec.

Building FLAC (optional)

Compile iLBC.swc (optional)

Download Adobe Alchemy

Download flex 4.6

Getting Started/Install Adobe Alchemy

After having installed Alchemy and Flex SDK, just run the commands below:

$ alc-on
$ make all


Full Usage of flac.swc at src/net/sourceforge/flac/codec/

AS3 Code

Methods encode and decode are asyncronous and take as their first params a callback for completed. yield is the number of loops of encodign before the program yields to the main process. It should be noted that this encoder accepts 16bit mono audio at 16000 hz, whereas the flash default is 32bit and the sample rate is controlled by mic.rate. If you wish to change this to any other value, you could easily just modify the FLAC__stream_encoder_set* inputs in the wrapper in c and recompile.


import cmodule.flac.CLibInit;
import org.ilbc.event.FLACEvent;

Initialization of lib

private var flacCodec:Object;
ilbcCodec = (new cmodule.flac.CLibInit).init();


encodedData = new ByteArray();
encodedData.endian = Endian.LITTLE_ENDIAN;
flacCodec.encode(encodingCompleteHandler, encodingProgressHandler, rawPCMByteArray, encodedData, decodedData.length, yield);

Progress Handler

function progressHandler(progress:int):void;
Something went wrong with that request. Please try again.