JSPM

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

PCM Equalizer implementation for Discord Player

Package Exports

  • @discord-player/equalizer
  • @discord-player/equalizer/dist/index.js
  • @discord-player/equalizer/dist/index.mjs

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 (@discord-player/equalizer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@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