No description
Find a file
2025-09-18 18:52:52 +02:00
.babelrc minified version added 2021-10-30 12:02:07 +04:00
.eslintrc.json Initial commit 2021-10-29 12:55:34 +04:00
.gitignore Initial commit 2021-10-29 12:55:34 +04:00
index.js async decodeAudioData, cors example 2021-10-29 13:10:20 +04:00
index.min.js minified version added 2021-10-30 12:02:07 +04:00
LICENSE Add license 2025-09-18 18:52:52 +02:00
package-lock.json minified version added 2021-10-30 12:02:07 +04:00
package.json minified version added 2021-10-30 12:02:07 +04:00
README.md Add license 2025-09-18 18:52:52 +02:00

Waveformer

Calculates peaks of audio without drawing it to canvas or creating audio.

How it works

Based on Article from CSS Tricks

Installation

$ npm i waveformer

Usage

Only works in environment where AudioContext and fetch are defined, but you can provide your own through options (not tested in node.js, please use node-waveform or waveform-node)

import waveformer from 'waveformer'

const points = await waveformer(100, 'https://api.allorigins.win/raw?url=https://www.myinstants.com/media/sounds/epic.mp3')

options object:

waveformer(peaksNumber<Number>, url<String>, options<Object>)

options = {
  audioContext: AudioContext class,
  fetch: fetch async function,
  audioChannel: Number, // channel from which we should get data, default: 0
}

Glory to micro-packages (687 bytes minified)!

P.S: To person who published package at this name but then unpublished it. Blame yourself only, haha! 😝

License

MIT