From 032defcd4c79104fdea9cbccd3d6287dd788efcd Mon Sep 17 00:00:00 2001 From: Christoph Guttandin Date: Sun, 10 Dec 2023 03:49:51 +0100 Subject: [PATCH] docs(readme): document tempoSettings --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 90fb4b05..bb588c35 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,15 @@ guess(audioBuffer) `analyze()` and `guess()` do both support `offset` and `duration` as optional arguments. When specified these two values are used to select only a part of the given `AudioBuffer`. There usage is the same as described in the documentation of the [`AudioBufferSourceNode.start()`](https://webaudio.github.io/web-audio-api/#widl-AudioBufferSourceNode-start-void-double-when-double-offset-double-duration) method. +By default the bpm are expected to be between 90 and 180 bpm. This can be changed by specifying the `tempoSettings`. These can be passed as the last argument to `analyze()` or `guess()`. + +```js +// with an offset and duration +analyze(audioBuffer, 1, 10, { maxTempo: 120, minTempo: 60 }); +// with no other arguments +analyze(audioBuffer, { maxTempo: 120, minTempo: 60 }); +``` + ## Acknowledgement A more comprehensive implementation has been done by [José M. Pérez](https://jmperezperez.com). It