An open API service indexing awesome lists of open source software.

https://github.com/magnusthor/audiowaveforms

Generate audiowaveforms SVG
https://github.com/magnusthor/audiowaveforms

Last synced: 9 months ago
JSON representation

Generate audiowaveforms SVG

Awesome Lists containing this project

README

          

# audiowaveforms

Visualize audio (AudioBuffer) as a hortizontal waveform using SVG elements. It displays the waveform (amplitude) , progress and remaining during audio playback.

## Install

npm install audiowaveforms

## How to

Below is a brief description of how to use 'audiowaveforms'. As the things evolves i'll make sure that a proper documentations is available.

### Markup

Below is the SVGElement that represents (hold) the audiowavforms, embed this in your
application.












### Create an instance

const audioEl = document.querySelector("your Audio element selector");
const svg = document.querySelector("#audio-waves"); // as above
const aw = new AudioWaveform(audioBuffer,audioEl, svg);

### Update the waveform

Update the progress and remaining indicators.

// where 'aw' is the instance of yours

window.setInterval( () => {
this.audiowaveform.updateAudioPosition();
},1000 / 60);

### Other

See /examples folder or try this example app https://magnusthor.github.io/audiowaveforms/example/example.html