
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Node.js native addon wrapper for libsoxr (high quality and high performance offline audio resampler).
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.)
Install with npm:
npm i node-soxr
Note: the npm package includes pre-built binaries for:
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.
import { SoxrWrapper, SoxrQuality } from "node-soxr";
const soxr = new SoxrWrapper(48000, 44100, 2);
const resampledData = soxr.resample(data);
soxr.destroy();
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();
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.
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.
brew install libomp,sudo apt update && sudo apt install libgomp1,binding.gyp file if needed.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.
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.
FAQs
Node native addon wrapper for the SoxR C library.
We found that node-soxr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.