# @sapphi-red/web-noise-suppressor

> Noise suppressor nodes for Web Audio API.

Latest version **0.4.1** (published 2026-09-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sapphi-red/web-noise-suppressor
pnpm add @sapphi-red/web-noise-suppressor
yarn add @sapphi-red/web-noise-suppressor
bun add @sapphi-red/web-noise-suppressor
```

## Health

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

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

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.4.1 |
| Published | 2026-09-19 |
| First published | 2022-02-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 883 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Author | sapphi-red |
| Maintainers | sapphi-red |

## Links

- npm: https://www.npmjs.com/package/@sapphi-red/web-noise-suppressor
- Repository: https://github.com/sapphi-red/web-noise-suppressor
- Homepage: https://github.com/sapphi-red/web-noise-suppressor#readme
- Issues: https://github.com/sapphi-red/web-noise-suppressor/issues
- Funding: https://github.com/sponsors/sapphi-red
- npm.io page: https://npm.io/package/@sapphi-red/web-noise-suppressor

## Recent versions

- 0.4.1 (latest) — 2026-09-19
- 0.4.0 — 2026-08-09
- 0.3.5 — 2024-05-19
- 0.3.4 — 2024-03-25
- 0.3.3 — 2023-02-26
- 0.3.2 — 2022-10-30
- 0.3.1 — 2022-04-09
- 0.3.0 — 2022-03-30
- 0.2.0 — 2022-02-12
- 0.1.0 — 2022-02-07

## README

# @sapphi-red/web-noise-suppressor

[![npm version](https://badge.fury.io/js/@sapphi-red%2Fweb-noise-suppressor.svg)](https://badge.fury.io/js/@sapphi-red%2Fweb-noise-suppressor) ![CI](https://github.com/sapphi-red/web-noise-suppressor/workflows/CI/badge.svg)

Noise suppressor nodes for Web Audio API.

[Demo](https://web-noise-suppressor.sapphi.red)

This package provides three noise suppression nodes.

- NoiseGateWorkletNode: A simple noise gate implementation
- RnnoiseWorkletNode: Based on [xiph/rnnoise](https://github.com/xiph/rnnoise)
  - Using [shiguredo/rnnoise-wasm](https://github.com/shiguredo/rnnoise-wasm)
- SpeexWorkletNode: Based on [xiph/speexdsp](https://github.com/xiph/speexdsp)'s `preprocess` function
  - Using [sapphi-red/speex-preprocess-wasm](https://github.com/sapphi-red/speex-preprocess-wasm)
- GtcrnWorkletNode: Based on [Xiaobin-Rong/gtcrn](https://github.com/Xiaobin-Rong/gtcrn)
  - Using [sapphi-red/gtcrn-wasm](https://github.com/sapphi-red/gtcrn-wasm)

**This package requires AudioWorklet to work.**

## Install

```shell
npm i @sapphi-red/web-noise-suppressor # yarn add @sapphi-red/web-noise-suppressor
```

## Usage

This section is written only for vite users.

```ts
import { SpeexWorkletNode, loadSpeex } from '@sapphi-red/web-noise-suppressor'
import speexWorkletPath from '@sapphi-red/web-noise-suppressor/speexWorklet.js?url'
import speexWasmPath from '@sapphi-red/web-noise-suppressor/speex.wasm?url' // you can use `vite-plugin-static-copy` instead of this

const ctx = new AudioContext()

const speexWasmBinary = await loadSpeex({ url: speexWasmPath })
await ctx.audioWorklet.addModule(speexWorkletPath)

const stream = await navigator.mediaDevices.getUserMedia({
  audio: true,
})

const source = ctx.createMediaStreamSource(stream)
const speex = new SpeexWorkletNode(ctx, {
  wasmBinary: speexWasmBinary,
  maxChannels: 2,
})

source.connect(speex)
speex.connect(ctx.destination)
```

For more details, see [demo source code](https://github.com/sapphi-red/web-noise-suppressor/blob/main/demo/src/index.ts).

---
_Source: https://npm.io/package/@sapphi-red/web-noise-suppressor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
