# node-opus

> NodeJS native binding to OPUS

Latest version **0.3.3** (published 2019-10-15) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install node-opus
pnpm add node-opus
yarn add node-opus
bun add node-opus
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.3.3 |
| Published | 2019-10-15 |
| First published | 2015-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=5.10.0 |
| Dependencies | 4 |
| Unpacked size | 7.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 79 |
| Author | Mikko Rantanen |
| Maintainers | rantanen |

## Links

- npm: https://www.npmjs.com/package/node-opus
- Repository: https://github.com/Rantanen/node-opus
- Issues: https://github.com/Rantanen/node-opus/issues
- npm.io page: https://npm.io/package/node-opus

## Dependencies (4)

- [nan](https://npm.io/package/nan.md) ^2.14.0
- [bindings](https://npm.io/package/bindings.md) ~1.2.1
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [ogg-packet](https://npm.io/package/ogg-packet.md) ^1.0.0

## Recent versions

- 0.3.3 (latest) — 2019-10-15
- 0.3.2 — 2019-05-27
- 0.3.1 — 2018-10-31
- 0.3.0 — 2018-05-06
- 0.2.9 — 2018-05-06
- 0.2.8 — 2018-05-06
- 0.2.7 — 2017-09-09
- 0.2.6 — 2017-04-07
- 0.2.5 — 2017-04-02
- 0.2.4 — 2016-11-08
- 0.2.3 — 2016-11-07
- 0.2.2 — 2016-09-29
- 0.2.1 — 2016-06-27
- 0.2.0 — 2016-06-05
- 0.1.13 — 2016-04-30
- … 13 more at https://npm.io/package/node-opus/versions

## README

node-opus
=========
### NodeJS native bindings to libopus

This module implements bindings for Opus v1.1 for Node.js.

```js
var opus = require('node-opus');

// Create the encoder.
// Specify 48kHz sampling rate and 10ms frame size.
// NOTE: The decoder must use the same values when decoding the packets.
var rate = 48000;
var encoder = new opus.OpusEncoder( rate );

// Encode and decode.
var frame_size = rate/100;
var encoded = encoder.encode( buffer, frame_size );
var decoded = encoder.decode( encoded, frame_size );

// or create streams
var channels = 2;
var opusEncodeStream = new opus.Encoder(rate, channels, frame_size);
var opusDecodeStream = new opus.Decoder(rate, channels, frame_size);
// see examples folder for a more complete example
```

Platform support
----------------

Supported platforms:
- Linux x64 & ia32
- Linux ARM (Raspberry Pi 1 & 2)
- Linux ARM64 (Raspberry Pi 3)
- Mac OS X x64
- Windows x64


Add new supported platforms by running ./autogen.sh and ./configure in
deps/opus and copying the resulting config.h to deps/config/opus/[os]/[arch].

Use the following flags with configure:

    ./configure --enable-static --disable-shared --with-pic

On a clean debian-based system, the full flow looks approximately like:

	sudo apt-get update
	sudo apt-get install autoconf
	sudo apt-get install libtool
	cd deps/opus
	./autogen.sh
	./configure --enable-static --disable-shared --with-pic
	mkdir -p ../config/opus/[os]/[arch]
	cp config.h ../config/opus/[os]/[arch]

And, then, the last step is to add the OS/Arch to `package.json`.

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