TwoLAME 0.4.0 WebAssembly build instructions
================================================

The distributed twolame.js and twolame.wasm files were built from the
unmodified TwoLAME 0.4.0 source archive and twolame-wrapper.c included next
to this file. Emscripten SDK 6.0.11 was used.

1. Extract twolame-0.4.0.tar.gz.
2. Activate Emscripten SDK 6.0.11.
3. In the extracted source directory run:

   emconfigure ./configure --disable-sndfile --disable-shared --enable-static
   emmake make -C libtwolame

4. From the directory containing twolame-wrapper.c run:

   emcc twolame-wrapper.c \
     /path/to/twolame-0.4.0/libtwolame/.libs/libtwolame.a \
     -I/path/to/twolame-0.4.0/libtwolame -O3 \
     -s MODULARIZE=1 -s EXPORT_NAME=TwoLameModule -s ENVIRONMENT=worker \
     -s ALLOW_MEMORY_GROWTH=1 -s FILESYSTEM=0 \
     -s EXPORTED_FUNCTIONS='["_tl_create","_tl_encode","_tl_flush","_tl_destroy","_malloc","_free"]' \
     -s EXPORTED_RUNTIME_METHODS='["HEAP16","HEAPU8"]' \
     -o twolame.js

The resulting twolame.js and twolame.wasm files are separate from the
application code and can be replaced with an interface-compatible build.
