A magical library for controlling audio pitch and volume, based on jungle.js
npm i audio-hacker
yarn add audio-hacker
pnpm add audio-hacker
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);
// best step 0.01
audioHacker.setPitchOffset(0.22);
audioHacker.setPitchOffset(-0.12);
// minimum value is 0;
audioHacker.setVolume(0.3);
audioHacker.setVolume(3.3);
audioHacker.setPanner(true);
audioHacker.setPanner(false);
audioHacker.setStereoPanner(1);
audioHacker.setStereoPanner(-1);
audioHacker.disconnect();
If you want to do it in a simpler way, use Video Roll browser extension.