Package Exports
- @4players/voice-filter
- @4players/voice-filter/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@4players/voice-filter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@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-filterUsage
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 channelattenuationLimit: number— dB limit for noise attenuationpostFilterBeta: number— Post-filter smoothing factorstereo: 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