Skip to main content

Overview

@seastart/srtc-plugin-rnnoise is an AI noise suppression plugin based on RNNoise (AudioWorklet + WebAssembly) that implements the SDK’s TrackProcessor interface. Compared with the browser’s native noiseSuppression, RNNoise suppresses both stationary and non-stationary noise (keyboard, fans, ambient noise, etc.) more strongly.

Installation


Host the static assets

The plugin depends on three static assets (in the package’s assets/ directory):
  • rnnoise-runtime.js
  • rnnoise-processor.js
  • rnnoise-processor.wasm
rnnoise-runtime.js locates the worklet and wasm in the same directory via document.currentScript.src, so these three files must be placed in the same directory, and basePath must point to it.
Copy the assets to your static directory, for example public/rnnoise/:
In Vite projects you can also copy them automatically at build time with vite-plugin-static-copy.

Usage

To turn off noise suppression and restore the original microphone track:

Options


Trade-offs vs. native noiseSuppression

For low-end devices or scenarios with little noise, keep using the native noiseSuppression of createLocalMicTrack; for strong noise and high call-quality requirements, use this plugin.

Notes

  • Supports audio tracks only.
  • Must run over HTTPS (or localhost); AudioContext may need a user gesture before it can resume.
  • The sample rate is fixed at 48 kHz.
  • After switching the microphone device (changeDeviceId) or calling startCapture again, noise suppression resumes automatically; you don’t need to call setProcessor again.
  • Can be chained with other processors; see Audio/video processors.