1.1.0 • Published 6 months ago

@4players/voice-filter v1.1.0

Weekly downloads
-
License
MIT OR Apache-2.0
Repository
-
Last release
6 months ago

@4players/voice-filter

A WebAssembly-based real-time voice isolation filter for mono and stereo audio. This package provides a JavaScript wrapper for a low-latency denoising filter compiled from native code.

Features

  • WebAssembly-powered denoising filter
  • Mono and stereo support
  • Adjustable attenuation and post-filter parameters
  • Efficient audio buffer management
  • Simple async API

Installation

npm install @4players/voice-filter

Usage

import { Vif } from '@4players/voice-filter';

const filter = await Vif.create(true); // `true` for stereo

// Configure parameters
filter.attenuationLimit = 90;
filter.postFilterBeta = 0.5;

// Process audio
const input = new Float32Array(...); // Fill with input samples (20ms 48kHz stereo interleaved)
const output = new Float32Array(input.length);
const lsnr = filter.processFrame(input, output);

// Clean up
filter.close();

API

Vif.create(stereo: boolean): Promise<Vif>

Creates a filter instance. stereo determines mono/stereo mode.

Properties

  • frameLength: number — Frame length required per channel
  • attenuationLimit: number — dB limit for noise attenuation
  • postFilterBeta: number — Post-filter smoothing factor
  • stereo: boolean — Indicates stereo mode

processFrame(input: Float32Array, output: Float32Array): number

Processes a frame and returns a signal-to-noise ratio estimate.

close()

Unregisters internal memory buffers and destroys the filter instance.

License

MIT or APACHE-2.0

1.1.0

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago