Audio Waveform SVG Path
Building path for SVG element to perform waveform view of audio file
Inspired by:
https://robots.thoughtbot.com/javascript-audio-api
Demo:
https://antonkalinin.github.io/audio-waveform-svg-path/
Installation
npm install --save audio-waveform-svg-path
Usage
; const trackWaveform = url: 'url of audio file'; trackWaveform;
Constructor assepts object with one of keys:
url: 'url address of audio file' buffer: 'audio as AudioBuffer'
Methods
-
loadFromUrl - loads audio from url, returns Promise
-
getPath(preprocessChannels) - returns a path of waveform, accepts callback function as only arument
Example of getPath with callback
const diffPath = trackWaveform;