![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
bpm-detective
Advanced tools
Detects the BPM of a song or audio sample
This module uses the Web Audio API to try and detect the BPM of a given sound. You can find more on the implementation and how it works by reading the blog post Beat Detection Using JavaScript and the Web Audio API which happens to be where I got most of the code.
$ npm install --save bpm-detective
The module exports one function. The function takes an AudioBuffer as it's only argument. It returns a promise that resolves to the detected BPM. If the sample was too short or if, for any other reason, the detection failed, the promise will be rejected.
import detect from 'bpm-detective';
let context = new AudioContext();
// Fetch some audio file
fetch('some/audio/file.wav')
// Get response as ArrayBuffer
.then(response => response.arrayBuffer())
.then(buffer => {
// Decode audio into an AudioBuffer
return new Promise((resolve, reject) => {
context.decodeAudioData(buffer, resolve, reject);
});
})
// Run detection
.then(detect)
// Log error
.catch(::console.error)
// Log result
.then(bpm => console.log(`Detected BPM: ${ bpm }`)):
The detection presumes you are working with dance(-ish) kind of music and as so looks only in the 90-180 BPM spectrum.
MIT
FAQs
Detects the BPM of a song or audio sample
The npm package bpm-detective receives a total of 0 weekly downloads. As such, bpm-detective popularity was classified as not popular.
We found that bpm-detective demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.