# @ecliptia/faad2-wasm

> FAAD2 WASM decoder with Node.js support and Windows build compatibility (fork of @ohrstrom/faad2-wasm)

Latest version **2.11.2-ecliptia.3** (published 2026-11-28) · AGPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @ecliptia/faad2-wasm
pnpm add @ecliptia/faad2-wasm
yarn add @ecliptia/faad2-wasm
bun add @ecliptia/faad2-wasm
```

## Health

**Score 60/100 (C)** — status: active.

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

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.11.2-ecliptia.3 |
| Published | 2026-11-28 |
| First published | 2025-10-12 |
| Weekly downloads | 0 |
| License | AGPL-3.0-or-later |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=16.0.0 |
| Dependencies | 1 |
| Unpacked size | 305.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jonas Ohrstrom |
| Maintainers | 1lucas1apk |
| Keywords | aac, audio, decoder, faad2, wasm, audio-decoding, web-audio, nodejs, adts, windows, stereo |

## Links

- npm: https://www.npmjs.com/package/@ecliptia/faad2-wasm
- Repository: https://github.com/Ecliptia/faad2-wasm
- Homepage: https://github.com/Ecliptia/faad2-wasm#readme
- Issues: https://github.com/Ecliptia/faad2-wasm/issues
- npm.io page: https://npm.io/package/@ecliptia/faad2-wasm

## Dependencies (1)

- [mp4box](https://npm.io/package/mp4box.md) ^2.1.2

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.11.2-ecliptia.3 (latest) — 2026-11-28
- 2.11.2-ecliptia.2 (ecliptia) — 2025-10-12
- 2.11.2-ecliptia.1 — 2025-10-12

## README

# FAAD2 WASM Bindings

This project provides a WebAssembly (WASM) binding for the FAAD2 AAC decoder, allowing it to be used in web applications.  
The main motivation to provide a WASM based `FAAD2Decoder` replacement is to support decoding of AAC audio streams in environments where the native `AudioDecoder` API is not available or does not support AAC.

Currently only Chromium-based seem to natively support AAC-HE decoding - but there is no support for PS (Parametric Stereo).
This library allows you to decode AAC-HE and AAC-HE-v2 with PS in browsers that do not support it natively.

## Usage

### Browser Usage

```javascript
import FAAD2Decoder from '@ohrstrom/faad2-wasm/faad2_decoder.js'
```

`FAAD2Decoder` works as a drop-in replacement for [AudioDecoder](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder)

```javascript
const audioDecoder = new FAAD2Decoder({
  output: processAudio,
  error: onEncoderError,
});

const asc = new Uint8Array([0x13, 0x14, 0x56, 0xe5, 0x98])  
await audioDecoder.configure({
  'mp4a.40.5',
  sampleRate: 48_000,
  numberOfChannels: 2,
  description: asc.buffer,
})

```

### Node.js Usage

```javascript
import FAAD2NodeDecoder from '@ohrstrom/faad2-wasm/faad2_node_decoder.js'

const decoder = new FAAD2NodeDecoder()
await decoder.ready

// Decode AAC data
const aacData = Buffer.from([/* your AAC data */])
const pcmData = await decoder.decode(aacData)

console.log('Sample Rate:', decoder.sampleRate)
console.log('Channels:', decoder.channels)
console.log('PCM Data:', pcmData) // Float32Array
```

The Node.js decoder automatically detects:
- ADTS headers and extracts AudioSpecificConfig
- Sample rate and channel configuration
- Supports stereo output (2 channels)
- Returns Float32Array with decoded PCM audio

## Copyrights FAAD2

```text
For FAAD2 the following license applies:

******************************************************************************
** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
** Any non-GPL usage of this software or parts of this software is strictly
** forbidden.
**
** The "appropriate copyright message" mentioned in section 2c of the GPLv2
** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
**
** Commercial non-GPL licensing of this software is possible.
** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
******************************************************************************


Please note that the use of this software may require the payment of
patent royalties. You need to consider this issue before you start
building derivative works. We are not warranting or indemnifying you in
any way for patent royalities! YOU ARE SOLELY RESPONSIBLE FOR YOUR OWN
ACTIONS!
```

Also see [github.com/knik0/faad2](https://github.com/knik0/faad2) and
[COPYING](https://github.com/knik0/faad2/blob/master/COPYING)

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