Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 28 lines (19 sloc) 1.661 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
raff is a JavaScript implementation of various file formats. Both encoding from and decoding to sensible JS representations is provided - for example, audio data can be represented as a Float32Array, encoded to a WAV file, and decoded back into a Float32Array as is appropriate for the Web Audio API. Similarly, a Bitmap file may be represented as is done in a HTML5 canvas data array, or perhaps a two-dimensional array of palette indices (plus a separate palette object).

Codecs may be accessed via RequireJS modules in the format like so:

    require(['types/audio/wav'], function(wav) { ... })

Codecs are in the types folder, sorted and named according to Internet media (MIME) type.

The following codecs are working partially:
* audio/wav - Microsoft WAVE audio

The following codecs are coming soon:
* image/bitmap

The following codecs are in the pipeline, but as yet not started:
* audio/flac
* audio/ogg
* video/avi
* image/png
* image/jpeg

While browsers may (eventually) provide methods for generating encoded data, as is currently available for the canvas tag, there are two reasons to justify this project regardless:
1. Browsers may limit the amount of control that may be applied to each file created (e.g. canvas getDataURL [sic] isn't going to allow you to extract a 1-bit bitmap file with the palette colours as red and grey)
2. The context may be outside of the browser

The name 'raff' is a Rocky Horror-esque pun on the 'RIFF' container format name, which is one of the first implemented components of this project. As always, this is in very early stages, here be dragons.

This will probably always be in a very early stage, in fact.
Something went wrong with that request. Please try again.