package
Calculate bpm from raw audio
npm install bpm.jsGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Calculate bpm from a raw audio stream. pure js. non blocking.
Install with npm
$ npm install bpm.jsvar bpmSink = require('bpm.js')
var spawn = require('child_process').spawn
createAudioStream("track.mp3")
.pipe(bpmSink())
.on("bpm", function(bpm){
console.log("bpm is %d", bpm)
});
// needed to convert mp3 to proper format
function createAudioStream(filename) {
var args = "-t raw -r 44100 -e float -c 1 -".split(" ")
args.unshift(filename)
var sox = spawn("sox", args)
return sox.stdout
}
This source code was human-transpiled from the C version here:
http://www.pogo.org.uk/~mark/bpm-tools/
GPLv2Estimated unpacked size across 11 packages.
958.5 kB
Includes dependencies.
3 direct · 3 outdated