vibrato

1.0.1 • Public • Published

vibrato NPM version

Web Audio API vibrato effect.

Installation

Install the package with NPM:

$ npm install vibrato

Usage

The package exposes a function that accepts an AudioContext as the first argument, and an AudioParam as the second. Optionally, an object specifying rate and depth can also be provided as the third argument. When called, the function will apply a vibrato effect to the AudioParam.

Example:

import vibrato from "vibrato";
 
let context = new (window.AudioContext || window.webkitAudioContext)();
let oscillator = context.createOscillator();
oscillator.connect(context.destination);
oscillator.start();
 
vibrato(context, oscillator.frequency, { rate: 4, depth: 16 });

Furthermore, as a convenient shorthand, you can pass in an OscillatorNode directly:

vibrato(oscillator, { rate: 4, depth: 16 });

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i vibrato

    Weekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • lukehorvat