Deepfilternet3-noise-filter is a real-time noise suppression and speech enhancement module that integrates DeepFilterNet3 with the LiveKit client.
JavaScript
66
81 commits
updated Jun 26, 2026
AI-powered noise suppression for real-time audio processing with LiveKit.
Based on the DeepFilterNet paper and implementation by Rikorose.
npm install deepfilternet3-noise-filter
import { DeepFilterNet3Core } from 'deepfilternet3-noise-filter';
// Create audio context
const ctx = new (window.AudioContext || window.webkitAudioContext)({ sampleRate: 48000 });
// Initialize processor
const proc = new DeepFilterNet3Core({
sampleRate: 48000,
noiseReductionLevel: 0
});
await proc.initialize();
// Create audio worklet node
const node = await proc.createAudioWorkletNode(ctx);
// Connect your audio stream
const src = ctx.createMediaStreamSource(stream);
const dst = ctx.createMediaStreamDestination();
src.connect(node).connect(dst);
// Adjust noise reduction level (0-100)
proc.setSuppressionLevel(50);
import React, { useRef, useEffect } from 'react';
import { DeepFilterNet3Core } from 'deepfilternet3-noise-filter';
function AudioProcessor({ stream, level = 50 }) {
const ctxRef = useRef(null);
const procRef = useRef(null);
const nodeRef = useRef(null);
useEffect(() => {
const setupAudio = async () => {
const ctx = new (window.AudioContext || window.webkitAudioContext)({ sampleRate: 48000 });
ctxRef.current = ctx;
const proc = new DeepFilterNet3Core({
sampleRate: 48000,
noiseReductionLevel: 0
});
await proc.initialize();
procRef.current = proc;
const node = await proc.createAudioWorkletNode(ctx);
nodeRef.current = node;
const src = ctx.createMediaStreamSource(stream);
const dst = ctx.createMediaStreamDestination();
src.connect(node).connect(dst);
proc.setSuppressionLevel(level);
};
if (stream) {
setupAudio();
}
return () => {
if (procRef.current) {
procRef.current.destroy();
}
};
}, [stream, level]);
return null; // This component only handles audio processing
}
No configuration needed - WebAssembly files and worker code are automatically handled!
This package works out-of-the-box with all modern bundlers:
Worker and worklet files are automatically inlined as blob URLs, so no webpack configuration or copy plugins are required. Just npm install and use!
import { DeepFilterNoiseFilterProcessor } from 'deepfilternet3-noise-filter';
// Create the processor
const filter = new DeepFilterNoiseFilterProcessor({
sampleRate: 48000,
noiseReductionLevel: 80,
enabled: true,
assetConfig: {
cdnUrl: 'https://cdn.mezon.ai/AI/models/datas/noise_suppression/deepfilternet3' // Optional: use custom CDN
}
});
// Use with LiveKit
await audioTrack.setProcessor(filter);
await room.localParticipant.publishTrack(audioTrack);
// Control noise reduction
filter.setSuppressionLevel(60);
filter.setEnabled(false); // Disable temporarily
For a complete React example, see: DeepFilterNet3 React Example
By default, the package loads WASM and model files from the bundled assets. You can optionally configure a custom CDN:
const filter = new DeepFilterNoiseFilterProcessor({
sampleRate: 48000,
noiseReductionLevel: 80,
assetConfig: {
cdnUrl: 'https://your-cdn-url.com/path/to/assets'
}
});
Different versions use different asset path structures:
Version <= 1.1.2:
{cdnUrl}/pkg/df_bg.wasm{cdnUrl}/models/DeepFilterNet3_onnx.tar.gzVersion >= 1.2.0:
v2/ subdirectory (automatically added){cdnUrl}/v2/pkg/df_bg.wasm{cdnUrl}/v2/models/DeepFilterNet3_onnx.tar.gzNote: The v2/ prefix is added automatically by the package for version >= 1.2.0, so you don't need to include it in your cdnUrl configuration.
yarn
yarn build
Outputs:
dist/This package is based on DeepFilterNet by Rikorose.
Original Paper:
The included model archive DeepFilterNet3_onnx.tar.gz is from:
Please refer to the upstream repository for licensing and updates.
The WASM module is built with optimized settings in libDF/Cargo.toml:
Rust Compiler Settings ([profile.release]):
opt-level = 3 # Maximum optimization for performance
lto = "thin" # Thin Link-Time Optimization
codegen-units = 1 # Single codegen unit for better optimization
panic = "abort" # Smaller binary size
WASM Optimizer Settings ([package.metadata.wasm-pack.profile.release]):
wasm-opt = [
"-O4", # Highest optimization level
"--enable-simd", # Enable simd
"--enable-bulk-memory", # Enable bulk memory operations
"--enable-nontrapping-float-to-int" # Enable non-trapping float-to-int conversions
]
To regenerate the WASM package and copy resources from the upstream project:
# Clone the DeepFilterNet repository
git clone https://github.com/Rikorose/DeepFilterNet/
cd DeepFilterNet/libDF
# Configure Cargo.toml with the optimization settings above
# Then build the WASM package with target features
RUSTFLAGS="-C target-feature=+simd128,+bulk-memory,+nontrapping-fptoint,+mutable-globals" \
wasm-pack build --target web --release --features wasm
# Copy WASM files to this repo
cd ..
cp -r libDF/pkg ../mezon-noise-suppression/df3
cd ../mezon-noise-suppression
yarn build
Build Notes:
+simd128: Enable SIMD 128-bit operations for vectorized processing+bulk-memory: Enable efficient bulk memory operations (memcpy, memset)+nontrapping-fptoint: Enable non-trapping float-to-int conversions+mutable-globals: Enable mutable global variableswasm-pack is installed: cargo install wasm-packThis project is dual-licensed under either:
at your option.
This licensing follows the upstream DeepFilterNet project by Hendrik Schröter, which uses the same dual-license approach. The DeepFilterNet WASM binaries and models included in this package are governed by the same licenses.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Deepfilternet3-noise-filter is a real-time noise suppression and speech enhancement module that integrates DeepFilterNet3 with the LiveKit client.
JavaScript
66
81 commits
updated Jun 26, 2026
AI-powered noise suppression for real-time audio processing with LiveKit.
Based on the DeepFilterNet paper and implementation by Rikorose.
npm install deepfilternet3-noise-filter
import { DeepFilterNet3Core } from 'deepfilternet3-noise-filter';
// Create audio context
const ctx = new (window.AudioContext || window.webkitAudioContext)({ sampleRate: 48000 });
// Initialize processor
const proc = new DeepFilterNet3Core({
sampleRate: 48000,
noiseReductionLevel: 0
});
await proc.initialize();
// Create audio worklet node
const node = await proc.createAudioWorkletNode(ctx);
// Connect your audio stream
const src = ctx.createMediaStreamSource(stream);
const dst = ctx.createMediaStreamDestination();
src.connect(node).connect(dst);
// Adjust noise reduction level (0-100)
proc.setSuppressionLevel(50);
import React, { useRef, useEffect } from 'react';
import { DeepFilterNet3Core } from 'deepfilternet3-noise-filter';
function AudioProcessor({ stream, level = 50 }) {
const ctxRef = useRef(null);
const procRef = useRef(null);
const nodeRef = useRef(null);
useEffect(() => {
const setupAudio = async () => {
const ctx = new (window.AudioContext || window.webkitAudioContext)({ sampleRate: 48000 });
ctxRef.current = ctx;
const proc = new DeepFilterNet3Core({
sampleRate: 48000,
noiseReductionLevel: 0
});
await proc.initialize();
procRef.current = proc;
const node = await proc.createAudioWorkletNode(ctx);
nodeRef.current = node;
const src = ctx.createMediaStreamSource(stream);
const dst = ctx.createMediaStreamDestination();
src.connect(node).connect(dst);
proc.setSuppressionLevel(level);
};
if (stream) {
setupAudio();
}
return () => {
if (procRef.current) {
procRef.current.destroy();
}
};
}, [stream, level]);
return null; // This component only handles audio processing
}
No configuration needed - WebAssembly files and worker code are automatically handled!
This package works out-of-the-box with all modern bundlers:
Worker and worklet files are automatically inlined as blob URLs, so no webpack configuration or copy plugins are required. Just npm install and use!
import { DeepFilterNoiseFilterProcessor } from 'deepfilternet3-noise-filter';
// Create the processor
const filter = new DeepFilterNoiseFilterProcessor({
sampleRate: 48000,
noiseReductionLevel: 80,
enabled: true,
assetConfig: {
cdnUrl: 'https://cdn.mezon.ai/AI/models/datas/noise_suppression/deepfilternet3' // Optional: use custom CDN
}
});
// Use with LiveKit
await audioTrack.setProcessor(filter);
await room.localParticipant.publishTrack(audioTrack);
// Control noise reduction
filter.setSuppressionLevel(60);
filter.setEnabled(false); // Disable temporarily
For a complete React example, see: DeepFilterNet3 React Example
By default, the package loads WASM and model files from the bundled assets. You can optionally configure a custom CDN:
const filter = new DeepFilterNoiseFilterProcessor({
sampleRate: 48000,
noiseReductionLevel: 80,
assetConfig: {
cdnUrl: 'https://your-cdn-url.com/path/to/assets'
}
});
Different versions use different asset path structures:
Version <= 1.1.2:
{cdnUrl}/pkg/df_bg.wasm{cdnUrl}/models/DeepFilterNet3_onnx.tar.gzVersion >= 1.2.0:
v2/ subdirectory (automatically added){cdnUrl}/v2/pkg/df_bg.wasm{cdnUrl}/v2/models/DeepFilterNet3_onnx.tar.gzNote: The v2/ prefix is added automatically by the package for version >= 1.2.0, so you don't need to include it in your cdnUrl configuration.
yarn
yarn build
Outputs:
dist/This package is based on DeepFilterNet by Rikorose.
Original Paper:
The included model archive DeepFilterNet3_onnx.tar.gz is from:
Please refer to the upstream repository for licensing and updates.
The WASM module is built with optimized settings in libDF/Cargo.toml:
Rust Compiler Settings ([profile.release]):
opt-level = 3 # Maximum optimization for performance
lto = "thin" # Thin Link-Time Optimization
codegen-units = 1 # Single codegen unit for better optimization
panic = "abort" # Smaller binary size
WASM Optimizer Settings ([package.metadata.wasm-pack.profile.release]):
wasm-opt = [
"-O4", # Highest optimization level
"--enable-simd", # Enable simd
"--enable-bulk-memory", # Enable bulk memory operations
"--enable-nontrapping-float-to-int" # Enable non-trapping float-to-int conversions
]
To regenerate the WASM package and copy resources from the upstream project:
# Clone the DeepFilterNet repository
git clone https://github.com/Rikorose/DeepFilterNet/
cd DeepFilterNet/libDF
# Configure Cargo.toml with the optimization settings above
# Then build the WASM package with target features
RUSTFLAGS="-C target-feature=+simd128,+bulk-memory,+nontrapping-fptoint,+mutable-globals" \
wasm-pack build --target web --release --features wasm
# Copy WASM files to this repo
cd ..
cp -r libDF/pkg ../mezon-noise-suppression/df3
cd ../mezon-noise-suppression
yarn build
Build Notes:
+simd128: Enable SIMD 128-bit operations for vectorized processing+bulk-memory: Enable efficient bulk memory operations (memcpy, memset)+nontrapping-fptoint: Enable non-trapping float-to-int conversions+mutable-globals: Enable mutable global variableswasm-pack is installed: cargo install wasm-packThis project is dual-licensed under either:
at your option.
This licensing follows the upstream DeepFilterNet project by Hendrik Schröter, which uses the same dual-license approach. The DeepFilterNet WASM binaries and models included in this package are governed by the same licenses.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.