This is an implementation of the SoundWave paper on the web. It enables you to detect motion using only the microphone and speakers!
Just run it like this
doppler.init(function(bandwidth) {
console.log(bandwidth.left - bandwidth.right);
});
See more in example.html. Read more about the theory of how this works on the github-pages site.
Unfortunately this doesn't work on Firefox since it doesn't seem to support the echoCancellation: false
parameter to navigator.getUserMedia. This means there's no way to turn off it filtering out the sounds which are coming from the computer itself (which is precisely what we want to measure).