@discord-player/equalizer
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

@discord-player/equalizer

This library implements Lavaplayer's 15 Band PCM Equalizer & biquad utilities.

Installation

$ yarn add @discord-player/equalizer

Example

Equalizer

import { EqualizerStream } from '@discord-player/equalizer';

// initialize 15 band equalizer stream
const equalizer = new EqualizerStream();

// set equalizer bands, in this case add some bass
equalizer.setEQ([
    { band: 0, gain: 0.25 },
    { band: 1, gain: 0.25 },
    { band: 2, gain: 0.25 }
]);

// input stream
const input = getPCMAudioSomehow();

// pipe input stream to equalizer
const output = input.pipe(equalizer);

// now do something with the output stream

Biquad

import { BiquadStream, FilterType } from '@discord-player/equalizer';

// initialize biquad stream
const biquad = new BiquadStream();

// initialize with filter
const biquad = new BiquadStream({
    filter: FilterType.LowPass
});

// set filter
biquad.setFilter(FilterType.HighPass);

// set gain (Gain is only applicable to LowShelf, HighShelf and PeakingEQ)
biquad.setGain(5);

// input stream
const input = getPCMAudioSomehow();

// pipe input stream to biquad
const output = input.pipe(biquad);

Supported Biquad Filters

  • SinglePoleLowPassApprox
  • SinglePoleLowPass
  • LowPass
  • HighPass
  • BandPass
  • Notch
  • AllPass
  • LowShelf
  • HighShelf
  • PeakingEQ

/@discord-player/equalizer/

    Package Sidebar

    Install

    npm i @discord-player/equalizer

    Weekly Downloads

    2,284

    Version

    0.2.3

    License

    MIT

    Unpacked Size

    269 kB

    Total Files

    7

    Last publish

    Collaborators

    • snowflake7
    • androz2091