# @audio/decode-opus

> Decode Ogg Opus audio with local libopus WASM

Latest version **1.3.1** (published 2026-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @audio/decode-opus
pnpm add @audio/decode-opus
yarn add @audio/decode-opus
bun add @audio/decode-opus
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2026-08-27 |
| First published | 2026-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 1 |
| Unpacked size | 178.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 208 |
| Author | audiojs |
| Maintainers | jamen, dfcreative, dy |
| Keywords | opus, ogg, audio, decode, decoder, wasm |

## Links

- npm: https://www.npmjs.com/package/@audio/decode-opus
- Repository: https://github.com/audiojs/decode
- Homepage: https://github.com/audiojs/decode/tree/master/packages/decode-opus#readme
- Issues: https://github.com/audiojs/decode/issues
- Funding: https://github.com/sponsors/audiojs
- npm.io page: https://npm.io/package/@audio/decode-opus

## Dependencies (1)

- [codec-parser](https://npm.io/package/codec-parser.md) ~2.5.0

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.3.1 (latest) — 2026-08-27
- 1.3.0 — 2026-08-11
- 1.2.3 — 2026-07-14
- 1.2.2 — 2026-07-11
- 1.2.1 — 2026-07-10
- 1.2.0 — 2026-07-10
- 1.1.1 — 2026-06-22
- 1.1.0 — 2026-06-22
- 1.0.0 — 2026-04-10

## README

# @audio/decode-opus

Decode Ogg Opus audio to PCM samples with libopus WASM.

```js
import decode, { decoder } from '@audio/decode-opus'

let { channelData, sampleRate } = await decode(opusBytes)

let dec = await decoder() // initialize WASM
let a = dec.decode(chunk1)
let b = dec.decode(chunk2)
let tail = dec.flush()
dec.free()
```

`decoder()` is asynchronous. Its `decode()` and `flush()` methods are synchronous. `flush()` ends the stream.

## Metadata

Read OpusTags metadata and cover art without decoding audio:

```js
import { parseMeta } from '@audio/decode-opus/meta'

let { meta, sampleRate } = parseMeta(opusBytes)
// meta: { title, artist, album, year, genre, ..., pictures }
```

## License

[ॐ](https://github.com/krishnized/license/) · [MIT](./LICENSE). Bundled [libopus](https://opus-codec.org/) is [BSD 3-Clause](./LICENSE.libopus).

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