libvorbis.js

Build Status

What?

libvorbis.js is an ASM.JS distribution of C libraries libogg, libvorbis, and libvorbisenc. It also includes a library wrapper that implements the W3C MediaRecorder interface**.

Ultimately, libvorbis.js allows you to encode PCM data to Ogg Vorbis in the browser. Ogg Vorbis is a free and open-source codec for lossy audio compression.

libvorbis.js is 216KB big (minified, gzipped) and runs about 3x slower in V8, compared to native. (2.5x in Firefox).

** Full compliance under development.

Why?

Yes, Firefox already supports the MediaRecorder API, which renders this library useless.

Unfortunately, Chromium (Chrome) does not yet ship a public, audio-capable implementation of MediaRecorder. (It should arrive with Chromium 49.)

libvorbis.js aims to fill this void for the time being.

Besides this, encoding audio in the browser is beneficial in the following ways:

OK, cool. What now?

Demo it.

Bare bones recorder

Voice Memos fork (original by: Paul Lewis)

Install it.

You can use bower to install libvorbis.js as a dependency:

bower install libvorbis.js

Download it.

Download from the distribution repo.

Build it.

Requirements

Preparations

npm install --dev

That should install (locally):

Instructions

git submodule init
git submodule update
make -j

Then, look for build/libvorbis.js or build/libvorbis.min.js.

Credits

Ogg License (BSD)

Copyright (c) 2002, Xiph.org Foundation

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Vorbis License (BSD)

Copyright (c) 2002-2015 Xiph.org Foundation

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.