Convert an audio file to a compressed (gzip) SVG waveform
This module uses a converted version of antonKalinin/audio-waveform-svg-path that runs in Node instead of in the browser.
const audioToSvgWaveform = require('audio-to-svg-waveform');
audioToSvgWaveform('./infile.mp3', './output.svg.gz')
.then(() => console.log('complete!'))
.catch(console.error)
The default stroke color is set to #000
but you can override with SVG_STROKE
environment variable. But that can be changed with CSS when the file is included inline.
The current, stable version of node.js supports 95% ES6 features.
Also, we build npm modules to run on older versions of Node.js.
We will use Babel.js with ES2015 preset to compile ES6 code to ES5.
Airbnb has an excellent style guide for ES6. We will follow the guide and adhere to the recommended coding style.
We will use ESLint with Airbnb style and pre-parse our code to detect violations of the style.
- Make sure you have recent, stable version of node (>= 6.1.0).
nave use stable
node -v
-
Clone or download this repo.
-
Get latest releases of the tools
npm update --save
npm run test
npm run lint
npm run build
npm run dev
npm run build
node lib/
or
npm start
./src - source code, stays in git repo.
./lib - transpiled ES5 code, not saved in git, gets published to npm.