Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
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 its only argument. It returns the detected BPM. If the sample was too short or if, for any other reason, the detection failed, the method throws an error.
import detect from 'bpm-detective'
const AudioContext = window.AudioContext || window.webkitAudioContext
const context = new AudioContext()
// Fetch some audio file
fetch('some/audio/file.wav').then(async function (response) {
// Get response as ArrayBuffer
const buffer = await response.arrayBuffer()
// Decode audio into an AudioBuffer
const data = await new Promise(function (resolve, reject) {
context.decodeAudioData(buffer, resolve, reject)
});
// Run detection
const bpm = detect(data)
alert(`Detected BPM: ${bpm}`)
}).catch(console.error)
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 22 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.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.