Socket
Book a DemoInstallSign in
Socket

@jitsi/rnnoise-wasm

Package Overview
Dependencies
Maintainers
10
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jitsi/rnnoise-wasm

Rnnoise sub-module compiled with emscripten as web assembly module

0.2.1
latest
Source
npmnpm
Version published
Weekly downloads
3.1K
-21.24%
Maintainers
10
Weekly downloads
 
Created
Source

rnnoise-wasm

rnnoise noise suppression library as a WASM module.

This repository contains the necessary utilities to build the library using a Docker build environment with Emscripten.

Build

Prerequisites

  • node - tested version v10.16.3
  • npm - tested version v6.9.0
  • docker - tested version 19.03.1

Building the module

Building is straightforward, run:

npm run build

The repository already has a pre-compiled version under the dist folder, running the above command will replace it with the newly compiled binaries and glue wasm .js file respectively.

In order to facilitate the build with docker the following prebuilt image is used trzeci/emscripten/ however, it is slightly altered by installing autotools components necessary for building rnnoise.

In summary the build process consists of two steps:

  • build:dockerfile - pulls in trzeci/emscripten/ which is then altered and saved. Any suqsequent build is going to check if the images was already installed and use that, so if one wants to make changes to the Dockerfile be sure to first delete the build image from your local docker repo.
  • build:emscripten - mounts the repo to the docker image from step one and runs build.sh on it. The bash script contains all the steps necessary for building rnnoise as a wasm module.

Usage

Currently the prebuilt files rnnoise.wasm along with the index.js are genererated using the old rnnoise release 0.1 while the sync version is generated using 0.2. This is done to keep compatibility with usage in jitsi meet, namely the old async version is used for noise detection while the new sync model is used for actual noise suppression within the context of an AudioWorklet. This will change in the future when jitsi meet noise detection will have updated heuristics using the new model. However, following a build all files in the dist files will be replaced with versions using the new model (both sync and async). Files replaced include the actual webassembly binary rnnoise.wasm and the generated emscriten.js file named rnnoise.js which contains glue code and the necessary libc runtime javascript bindings, as well as the rnnoise-sync.js file which is the sync loading version that has the binary wasm module inlined as a base64 string, this is useful for contexts that only allow synchronous loading of resources, like an AudioWorklet.

The repo is structured so it can be used as a npm dependency, with the entry point in dist/index.js, be mindful as using index.js automatically implies that rnnoise.wasm needs to be present as well, thus for a normal npm build system one must explicitly copy rnnoise.wasm to the project structure.

FAQs

Package last updated on 03 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.