Whistlerr is a whistle detection program which implements M. Nilsson's research paper - "Human Whistle Detection and Frequency Estimation".
Although it's accurate, it may fail against significant background noise. Demo here.
Works in node and browsers.
It works by detecting high energy spikes in the band of 500-5000Hz where most people blow whistles.
On the browser it uses HTML5 WebAudio API, and on node it relies on mic npm module.
You have to include build/whistle.build.js
and then call whistlerr
with callback function and threshold value.
sampleThreshold
is the minimum number of positive samples required to report a whistle.
High sampleThreshold
may fail to detect low intensity whistles while low sampleThreshold
may report too many.
var config = {
sampleThreshold: 10
};
whistlerr(function(result) {
console.log("Whistle detected with data: " + result);
}, config);
see demo/browser/
for a full example.
see demo/node/
for a full example.