0.2.1 • Published 2 years ago

rubberband-web v0.2.1

Weekly downloads
-
License
GPL-2.0-or-later
Repository
github
Last release
2 years ago

rubberband-web

A wasm-powered audio worklet using the Rubber Band library to provide pitch shifting for the Web Audio API.

Example

Checkout the example page here.

Usage

Add this package to your project using your favorite package manager:

npm install rubberband-web
# or
yarn add rubberband-web
# or
pnpm add rubberband-web

If you are using a framework using assets management (next.js, Angular, etc.), start by copying or linking this package's public/rubberband-processor.js into your public asset folder. In many cases you can also reference directly to the node_modules/rubberband-web/public/rubberband-processor.js.

Then use the helper function createRubberBandNode to create a worklet instance:

import { createRubberBandNode } from 'rubberband-web';

const audioCtx = new AudioContext();
const sourceNode = new AudioBufferSourceNode(audioCtx); // or any source

const rubberBandNode = await createRubberBandNode(
          audioCtx,
          '<public path to your rubberband-processor.js copy>'
        );

// Now you can do something like:
sourceNode.connect(rubberBandNode);
rubberBandNode.connect(audioCtx.destination);

// You can change the following parameters live at any time:
rubberBandNode.setPitch(1.2);
rubberBandNode.setTempo(0.6);
rubberBandNode.setHighQuality(true);
0.2.1

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago