npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

wasm-audio-ferrite

v0.1.4

Published

High-performance real-time audio noise reduction powered by WebAssembly and Rust

Readme

WASM Audio Ferrite

High-performance, real-time audio noise reduction library powered by WebAssembly and Rust.

Overview

WASM Audio Ferrite is a cutting-edge noise reduction system that brings professional-grade audio processing to the web. Built with Rust and compiled to WebAssembly, it delivers near-native performance with sub-millisecond latency.

Key Features

  • 🚀 Blazing Fast: Sub-millisecond processing latency (0.055ms for 256 samples @ 48kHz)
  • 🔧 Zero-Copy API: Minimal memory overhead with direct WASM memory access
  • 🎛️ Multi-Stage Processing: Combines spectral subtraction and noise gating
  • 🎵 Musical Noise Reduction: Advanced Wiener filtering with comfort noise
  • 📊 Adaptive Noise Profiling: Learn and remove background noise in real-time
  • 🌐 Cross-Platform: Works in any modern web browser with WebAssembly support

Performance Benchmarks

| Buffer Size | Sample Rate | Processing Time | CPU Usage | Real-time Factor | |-------------|-------------|-----------------|-----------|------------------| | 256 samples | 48 kHz | 0.055ms | <2% | 96x | | 512 samples | 48 kHz | 0.065ms | <1.5% | 164x | | 2048 samples| 48 kHz | 0.175ms | <0.5% | 244x |

Quick Start

Installation

# Clone the repository
git clone https://github.com/macaque-suf/ferrite
cd wasm-audio-ferrite

# Install dependencies
npm install

# Build WASM module and TypeScript bindings
npm run build

# Run demos
npm run dev

Basic Usage

import { NoiseProcessor } from '@wasm-audio-ferrite/toolkit';

// Initialize the processor
const processor = await NoiseProcessor.create({
  sampleRate: 48000,
  useZeroCopy: true // Enable zero-copy API for best performance
});

// Configure noise reduction
processor.setReductionAmount(0.5); // 0.0 = minimal, 1.0 = maximum
processor.setGateThreshold(-40);   // dB
processor.setWienerMode(true);     // Enable Wiener filtering

// Process audio
const processedAudio = processor.processFrame(inputBuffer);

Demos

The project includes several interactive demos:

  1. Main Demo - Complete noise reduction interface with file upload and real-time processing
  2. Live Passthrough - Real-time microphone processing with performance metrics
  3. Zero-Copy Benchmark - Compare regular vs zero-copy API performance
  4. Testing Suite - Advanced parameter tuning and stage-by-stage visualization

Architecture

┌─────────────────────────────────────────────┐
│           Web Audio API (JavaScript)         │
├─────────────────────────────────────────────┤
│         TypeScript Wrapper (@toolkit)        │
├─────────────────────────────────────────────┤
│      WebAssembly Module (wasm-bindgen)      │
├─────────────────────────────────────────────┤
│         Rust Core (audio-processor)         │
│  ┌─────────────┐        ┌──────────────┐   │
│  │  Spectral   │        │   Noise      │   │
│  │ Subtraction │   ───> │    Gate      │   │
│  └─────────────┘        └──────────────┘   │
└─────────────────────────────────────────────┘

Components

  • audio-processor-core/ - Rust implementation of noise reduction algorithms
  • packages/toolkit/ - TypeScript/JavaScript wrapper with Web Audio integration
  • demo/ - Interactive demonstrations and performance tests

Building from Source

Prerequisites

  • Rust 1.70+ with wasm32-unknown-unknown target
  • Node.js 18+
  • wasm-pack (cargo install wasm-pack)

Build Commands

# Build WASM module
npm run build:wasm

# Build TypeScript toolkit
npm run build:toolkit

# Build everything
npm run build

# Run development server
npm run dev

API Documentation

NoiseProcessor Class

The main interface for audio processing:

class NoiseProcessor {
  // Create a new processor instance
  static async create(config: ProcessorConfig): Promise<NoiseProcessor>
  
  // Process audio frame (regular API)
  processFrame(input: Float32Array): Float32Array
  
  // Process audio frame (zero-copy API)
  processFrameZeroCopy(input: Float32Array): Float32Array
  
  // Learn noise profile from background audio
  learnNoise(samples: Float32Array): void
  
  // Configuration methods
  setReductionAmount(amount: number): void  // 0.0 - 1.0
  setGateThreshold(dbfs: number): void      // Typically -60 to 0
  setWienerMode(enabled: boolean): void
  setBypass(enabled: boolean): void
}

Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.

License

MIT License - See LICENSE file for details

Acknowledgments

Built with:

Support

For issues, questions, or suggestions, please open an issue on GitHub.


WASM Audio Ferrite - Professional audio processing for the modern web 🎵