Gathering detailed insights and metrics for waveform-thumbnail
Gathering detailed insights and metrics for waveform-thumbnail
Gathering detailed insights and metrics for waveform-thumbnail
Gathering detailed insights and metrics for waveform-thumbnail
a simple waveform image generator with no hard dependencies outside npm
npm install waveform-thumbnail
Typescript
Module System
NPM Version
CoffeeScript (97.46%)
JavaScript (2.54%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
7 Stars
32 Commits
4 Watchers
1 Branches
1 Contributors
Updated on Aug 24, 2023
Latest Version
0.0.4
Package Id
waveform-thumbnail@0.0.4
Size
49.96 kB
NPM Version
1.4.14
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
A simple audio waveform image generator with no hard dependencies outside npm.
Just convert your audio to 32 bit little endian raw before converting. How you accomplish this depends on your platform, but here's how to do it with sox
:
sox foo.mp3 --bits 32 --encoding signed-integer --endian little foo.raw remix 1,2
Currently I can't find and modules in NPM that will do this conversion for us without installing / compiling tools outside npm first. So I built this to work well in conjunction with sox
, which is pretty well supported everywhere.
1var Waveform = require('waveform'); 2var waveform = new Waveform( './someAudio.raw' ); 3waveform.renderAndSave( './prettyImage.png', function(err){ 4 console.log( "neato!" ) 5});
If you want more control, you can set color options.
1//... 2var waveform = new Waveform( './someAudio.raw', { 3 w: 500, 4 h: 100, 5 backgroundColor: '#333', 6 waveColor: '#fff' 7}); 8//...
You can also define your own gradient. This is the default one:
1//... 2var waveform = new Waveform( './someAudio.raw', { 3 w: 500, 4 h: 100, 5 backgroundColor: '#333', 6 waveColor: [ 7 {stop: 0, color: "#333"}, 8 {stop: 0.5, color: "#333"}, 9 {stop: 0.5, color: "#444"}, 10 {stop: 1, color: "#eee"} 11 ] 12}); 13//...
This tool is built on top of node canvas, and that canvas object is exposed if you want to do stuff with it before saving.
1//... 2waveform.render( function(err, ctx){ 3 ctx.fillStyle = 'red'; 4 ctx.fillRect( 0,0,10,10 ); 5 // etc 6 7 waveform.save( './myWaveformAndRedBox.png', function(err){ 8 console.log( "yay" ); 9 }) 10}); 11 12If you have trouble node-canvas running on OSX: [https://github.com/Automattic/node-canvas/wiki/Installation---OSX] 13 14Pull requests and bug reports are very welcome. Thanks!
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More