Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gxy5202/audio-hacker
π§A magical library for controlling audio pitch and volume, based on jungle.js
https://github.com/gxy5202/audio-hacker
audio pitch tune video volume webaudio
Last synced: about 2 months ago
JSON representation
π§A magical library for controlling audio pitch and volume, based on jungle.js
- Host: GitHub
- URL: https://github.com/gxy5202/audio-hacker
- Owner: gxy5202
- License: other
- Created: 2024-03-02T14:09:12.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-08-06T16:08:05.000Z (5 months ago)
- Last Synced: 2024-08-06T19:03:19.984Z (5 months ago)
- Topics: audio, pitch, tune, video, volume, webaudio
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/audio-hacker
- Size: 16.5 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π§audio-hacker
A magical library for controlling audio pitch and volume, based on [jungle.js](https://github.com/cwilso/Audio-Input-Effects/blob/master/js/jungle.js)# Installation
```
npm i audio-hackeryarn add audio-hacker
pnpm add audio-hacker
```
# Initial Audiohacker```javascript
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 audioController = new Audiohacker(audioCtx, source);
```
# Update pitch
```javascript// best step 0.01
audioController.setPitchOffset(0.22);
audioController.setPitchOffset(-0.12);```
# Update volume
```javascript// minimum value is 0;
audioController.setVolume(0.3);
audioController.setVolume(3.3);```
# Disconnect
```javascriptaudioController.disconnect();
```
# What more
If you want to do it in a simpler way, use [Video Roll](https://github.com/VideoRoll/VideoRoll) browser extension.