# @audio/decode-flac

> Decode FLAC audio with libFLAC WASM

Latest version **1.3.3** (published 2026-08-12) · MIT license · 0 weekly downloads

## Install

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

## 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.3 |
| Published | 2026-08-12 |
| First published | 2026-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 2 |
| Unpacked size | 147.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 208 |
| Author | audiojs |
| Maintainers | jamen, dfcreative, dy |
| Keywords | flac, audio, decode, decoder, wasm, lossless |

## Links

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

## Dependencies (2)

- [codec-parser](https://npm.io/package/codec-parser.md) ~2.5.0
- [@wasm-audio-decoders/flac](https://npm.io/package/@wasm-audio-decoders/flac.md) ~0.2.10

## 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

- 1.3.3 (latest) — 2026-08-12
- 1.3.2 — 2026-08-12
- 1.3.1 — 2026-08-12
- 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.0 — 2026-04-20
- 1.0.0 — 2026-04-10

## README

# @audio/decode-flac

Decode raw FLAC and Ogg FLAC audio with [@wasm-audio-decoders/flac](https://github.com/eshaz/wasm-audio-decoders).

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

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

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

`decoder()` initializes asynchronously. `decode()` and `flush()` are synchronous.
`decode()` accepts consecutive raw FLAC and complete Ogg FLAC files. Raw FLAC may omit
the STREAMINFO sample total. For chunked input, `flush()` ends the decoder.

## License

[ॐ](https://github.com/krishnized/license/) · [MIT](./LICENSE)

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