Package Exports
- audio-hacker
- audio-hacker/dist/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 (audio-hacker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
🎧audio-hacker
A magical library for controlling audio pitch and volume, based on jungle.js
Installation
npm i audio-hacker
yarn add audio-hacker
pnpm add audio-hacker
Initial Audiohacker
import Audiohacker from 'audio-hacker';
const audioCtx = new AudioContext();
if (audioCtx.state !== 'running') {
await audioCtx.resume();
}
const video = document.querySelector('video');
const source = audioCtx.createMediaElementSource(video);
const audioHacker = new Audiohacker(audioCtx, source);
Update pitch
// best step 0.01
audioHacker.setPitchOffset(0.22);
audioHacker.setPitchOffset(-0.12);
Update volume
// minimum value is 0;
audioHacker.setVolume(0.3);
audioHacker.setVolume(3.3);
Update panner
audioHacker.setPanner(true);
audioHacker.setPanner(false);
Update stereoPanner
audioHacker.setStereoPanner(1);
audioHacker.setStereoPanner(-1);
Disconnect
audioHacker.disconnect();
What more
If you want to do it in a simpler way, use Video Roll browser extension.