npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-soxr

v1.0.0

Published

Node native addon wrapper for the SoxR C library.

Readme

Node-Soxr

npm-tag git-tag

Node.js native addon wrapper for libsoxr (high quality and high performance offline audio resampler).


Installation

Requirements:

  • OpenMP runtime

    (Pre-built binaries for Linux systems are linked with GCC's OpenMP runtime (libgomp1), Windows and Mac is configured to link LLVM's OpenMP runtime by default. - If you would like to use a different OpenMP library, please edit the linker flags in the binding.gyp file accordingly.)

  • npm

  • Node.js >= 24 (Binaries are built on LTS node. Please rebuild from source manually if you want to target older node versions.)

Setup:

  1. Install with npm:

    npm i node-soxr

    Note: the npm package includes pre-built binaries for:

    • Linux (incl. builds for all architectures supported by LTS Node.js - based on glibc),
    • Alpine containers (all Node.js LTS supported architectures except s390x - can be built manually via running build.sh - based on musl),
    • Windows (x64 only),
    • and MacOS (x64, arm64 - without SIMD support).

    For different operating systems and architectures (ex. Windows - arm64): please make sure to install the necessary build tools on your system so the corresponding binaries can be built on your system at install time - if the required build tools are missing install will fail.

Usage:

General usage:

import { SoxrWrapper, SoxrQuality } from "node-soxr";

const soxr = new SoxrWrapper(48000, 44100, 2);
const resampledData = soxr.resample(data);
soxr.destroy();

With multi-threading enabled:

import * as NodeSoxr from "node-soxr";

const maxThreads = 8;
//Call this once to set the global limit - desirably on your module init
NodeSoxr.setGlobalMaximumThreadCount(maxThreads);

const soxr = new NodeSoxr.SoxrWrapper(48000, 44100, 2);
const resampledData = soxr.resample(data);
soxr.destroy();

Using utility functions:

import * as NodeSoxr from "node-soxr";

const inputSampleRate = 48000;
const outputSampleRate = 44100;
const numberOfAudioChannels = 5;

const soxr = new NodeSoxr.SoxrWrapper(
  inputSampleRate,
  outputSampleRate,
  numberOfAudioChannels,
  NodeSoxr.SoxrQuality.HIGH_16,
);

const inputData = NodeSoxr.interleaveChannelData(...channelDataArray);
const resampledData = soxr.resample(inputData);
const outputData = NodeSoxr.deinterleaveChannelData(
  resampledData,
  numberOfAudioChannels,
);

soxr.destroy();

For more extensive examples please click here.

At the moment only CBR resampling is supported. (This might not change.)

Building manually:

To build the library you may run npm run build, or use the provided shell script to manually build the library (sh ./build.sh). To see details about the flags that can be used with the build script please run sh ./build.sh -h or sh ./build.sh --help.

Dependencies:

  • Python3
  • C/C++ build tools (installing through the Node.js installer is recommended)
  • An OpenMP runtime:
    • on Windows it's shipped with MSVC,
    • on Mac please use brew install libomp,
    • on Linux please use sudo apt update && sudo apt install libgomp1,
    • for other environments please use your desired OpenMP runtime and change the linker flags in the binding.gyp file if needed.

Contributions:

The C++ standard used for this project is C++ 17.

All contributions are welcome. In order to contribute, please make a fork of this project and make a pull request to the main branch of this project once you added your changes.

Licensing/Credits:

This library is a wrapper built on top of the source code of the SoX Resampler Library.

This project is licensed under the terms of the LGPL 2.1 - see the LICENSE file for details.

For additional credits/licensing please refer to the notes section in the LICENSE.