1.0.1 • Published 7 years ago

wavearea v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

wavearea experimental

Edit waveform/audio/other data in textarea.

wavearea

Usage

npm install wavearea

const Wavearea = require('wavearea');
const autosize = require('autosize');

let inputEl = document.body.appendChild(document.createElement('textarea'));

autosize(inputEl);
let wavearea = Wavearea(inputEl, options);

wavearea.push(newData);
wavearea.set(data);

API

Get wave area constructor.

Create waveform editor instance based off options:

//sample values
samples: data,

//number of samples per bar
group: 64,

//mode of forming bar from bar samples - might be used to show log mapping etc
reduce: (prev, curr) => Math.max(prev, curr),

//bars or dots
style: 'bars',

//show reflection of data
reflected: false

Related

wavefont — typeface for rendering data. gl-waveform — wavearea used to paint waveform color based of spectral contents.