View on GitHub

Flac.js

JavaScript FLAC de- and encoder

Download this project as a .zip file Download this project as a tar.gz file
Flac.js is a JavaScript port of the flac tool, which in turn is part of the flac package, created with Emscripten. To say it in simple words, one could download all the static files making up this page and running them offline in a modern browser. No server side processing is required. Together with the sound recording API of contemporary browsers, one can not only build powerful audio editing solutions but also sound recording tools.
What is FLAC and why is FLAC great:

FLAC stands for Free Lossless Audio Codec, an audio format similar to MP3, but lossless, meaning that audio is compressed in FLAC without any loss in quality. This is similar to how Zip works, except with FLAC you will get much better compression because it is designed specifically for audio, and you can play back compressed FLAC files in your favorite player (or your car or home stereo, see supported devices) just like you would an MP3 file.

FLAC stands out as the fastest and most widely supported lossless audio codec, and the only one that at once is non-proprietary, is unencumbered by patents, has an open-source reference implementation, has a well documented format and API, and has several other independent implementations.

xiph.org/flac
To summarize: High compression rates, no loss in quality, lightning fast de- and encoding.

Demo

Try Flac.js, right here, right now. Clicking run will prompt for a WAV, AIFF, FLAC*, or RAW* file.

Browser support

In order to run the flac tool in a browser, there has to be support for a couple of HTML5 features.

JavaScript PostMessage WebWorkers Blob constructor WebAssembly

Additional command line switches

encoder@rillke.com$ flac
 

Borrow sample audio files

  • Loading ...

Ways to give

Flac.js made your day?

Comments

JavaScript error: Either JavaScript is still loading, it is disabled or something went terribly wrong. The demo will most likely not work. Please report this issue so it can be fixed.

Running from file:/// When running from file:/// protocol, it might be impossible to load the worker code due to security restrictions. Chrome and Opera can be started with the --allow-file-access-from-files command line argument to bypass this kind of protection. However, if access from files is granted, the browser should not be used to browse other sites.

JavaScript error: Either JavaScript is still loading, it is disabled or something went terribly wrong. The demo will most likely not work. Please report this issue so it can be fixed.

Running from file:/// When running from file:/// protocol, it might be impossible to load the worker code due to security restrictions. Chrome and Opera can be started with the --allow-file-access-from-files command line argument to bypass this kind of protection. However, if access from files is granted, the browser should not be used to browse other sites.

Drop your file here!