Ogg Vorbis encoding on the Browser
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.



vorbis-encoder-js is a JavaScript Library that encodes audio data to Ogg Vorbis on web browsers with Browserify.

libogg and libvorbis are used for encoding engine. Emscripten is used to convert libogg/libvorbis C code into JavaScript.

this project is inspired by OggVorbisEncoder.js.


$ npm install vorbis-encoder-js


var Encoder = require("vorbis-encoder-js").encoder;

var sampleRate = audioBuffer.sampleRate;
var numberOfChannels = audioBuffer.numberOfChannels;
var quality = 0; // -0.1 to 1 (Vorbis quality)
var tags = {
  TITLE: "test_ogg",
  ALBUM: "テストアルバム", // UTF-8 is usable
  ARTIST: "miyabisun",
  LOOPSTART: "10000",
  LOOPLENGTH: "30000"

var encoder = new Encoder(sampleRate, numberOfChannels, quality, tags);
var blob = encoder.finish();


Docker and Node.js are required to build the library.

$ npm run build

Download and extract libogg + libvorbis, build library files (see package.json and Makefile for more details).


libogg and libvorbis are released under Xiph's BSD-like license below. JavaScript-converted part of this library follows the same license.


This library is released under MIT licence, see LICENSE.txt.