JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 115
  • Score
    100M100P100Q77839F
  • License MIT

PCM audio mixer with customizable parameters

Package Exports

  • node-audio-mixer
  • node-audio-mixer/dist/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-audio-mixer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Node.js Audio Mixer

Npm packet

About

Audio mixer that allows mixing PCM audio streams with customizable parameters.

Installation

Node.js 18.0.0 or newer is required.

npm:

npm install node-audio-mixer

pnpm:

pnpm install node-audio-mixer

yarn:

yarn install node-audio-mixer

Example usage

import {createReadStream, createWriteStream} from "fs";
import {AudioMixer} from "node-audio-mixer";

const mixer = new AudioMixer({
    sampleRate: 48000,
    bitDepth: 16,
    channels: 1,
    autoClose: true,
});

const firstInput = mixer.createAudioInput({
    sampleRate: 48000,
    bitDepth: 16,
    channels: 1,
});
const secondInput = mixer.createAudioInput({
    sampleRate: 48000,
    bitDepth: 16,
    channels: 1,
});

const outputAudio = createWriteStream("mixed.pcm");

const firstAudio = createReadStream("firstAudio.pcm");
const secondAudio = createReadStream("secondAudio.pcm");

mixer.pipe(outputAudio);

firstAudio.pipe(firstInput);
secondAudio.pipe(secondInput);

More examples you can find here

API Documentation

You can find it here

Changelog

You can view the changelogs on GitHub releases

License

MIT