# vorbis

> Node.js native binding to libvorbis

Latest version **0.2.2** (published 2018-05-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install vorbis
pnpm add vorbis
yarn add vorbis
bun add vorbis
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2018-05-30 |
| First published | 2013-02-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 7.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 29 |
| Author | Nathan Rajlich |
| Maintainers | linusu, tootallnate |
| Keywords | ogg, vorbis, libvorbis, encode, decode, stream |

## Links

- npm: https://www.npmjs.com/package/vorbis
- Repository: https://github.com/TooTallNate/node-vorbis
- Homepage: https://github.com/TooTallNate/node-vorbis#readme
- Issues: https://github.com/TooTallNate/node-vorbis/issues
- npm.io page: https://npm.io/package/vorbis

## Dependencies (6)

- [nan](https://npm.io/package/nan.md) ^2.10.0
- [ogg](https://npm.io/package/ogg.md) ^1.2.5
- [debug](https://npm.io/package/debug.md) ^2.2.0
- [bindings](https://npm.io/package/bindings.md) ^1.2.0
- [buffer-alloc](https://npm.io/package/buffer-alloc.md) ^1.1.0
- [readable-stream](https://npm.io/package/readable-stream.md) ^2.3.6

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.2.2 (latest) — 2018-05-30
- 0.2.1 — 2016-01-20
- 0.2.0 — 2016-01-20
- 0.1.1 — 2014-07-28
- 0.1.0 — 2013-02-19
- 0.0.1 — 2013-02-13

## README

node-vorbis
========
### Node.js native binding to libvorbis
[![Build Status](https://travis-ci.org/TooTallNate/node-vorbis.svg?branch=master)](https://travis-ci.org/TooTallNate/node-vorbis)

This module provides Vorbis Encoder and Decoder classes compatible with `node-ogg`
streams.

Installation
------------

`node-vorbis` comes bundled with its own copy of `libvorbis`, so
there's no need to have the library pre-installed on your system.

Simply compile and install `node-vorbis` using `npm`:

``` bash
$ npm install vorbis
```


Example
-------

Decoder example:

``` javascript
var fs = require('fs');
var ogg = require('ogg');
var vorbis = require('vorbis');
var file = __dirname + '/Hydrate-Kenny_Beltrey.ogg';

var od = new ogg.Decoder();
od.on('stream', function (stream) {
  var vd = new vorbis.Decoder();

  // the "format" event contains the raw PCM format
  vd.on('format', function (format) {
    // send the raw PCM data to stdout
    vd.pipe(process.stdout);
  });

  // an "error" event will get emitted if the stream is not a Vorbis stream
  // (i.e. it could be a Theora video stream instead)
  vd.on('error', function (err) {
    // maybe try another decoder...
  });

  stream.pipe(vd);
});

fs.createReadStream(file).pipe(od);
```

Encoder example:

``` javascript
var ogg = require('ogg');
var vorbis = require('vorbis');

var oe = new ogg.Encoder();
var ve = new vorbis.Encoder();

// not yet implemented...
ve.addComment('ARTIST', 'Bob Marley');

// `process.stdin` *MUST* be PCM float 32-bit signed little-endian samples.
// channels and sample rate are configurable but default to 2 and 44,100hz.
process.stdin.pipe(ve)

// send the encoded Vorbis pages to the Ogg encoder
ve.pipe(oe.stream());

// write the produced Ogg file with Vorbis audio to `process.stdout`
oe.pipe(process.stdout);
```

See the `examples` directory for some more example code.

API
---

### Decoder class


### Encoder class

---
_Source: https://npm.io/package/vorbis · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
