Created
June 27, 2017 14:22
-
-
Save htor/efe15236a590688c86214070d2e8592e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<script src="https://unpkg.com/bpm-detective@2.0.1/dist/bpm-detective.js" charset="utf-8"></script> | |
<script> | |
let context = new AudioContext(); | |
fetch("01 Xtal.mp3") | |
.then(response => response.arrayBuffer()) | |
.then(data => context.decodeAudioData(data)) | |
.then(buffer => { | |
try { | |
const bpm = DetectBPM(buffer); | |
alert(`Detected BPM: ${bpm}`); | |
} catch (err) { | |
console.error(err); | |
} | |
}); | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment