
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
audio-frequency-to-index
Advanced tools
Convert a Hz frequency to an index for WebAudio frequency analysis. Also see audio-index-to-frequency.
The value is clamped between [ 0 .. frequencyBinCount ]. The frequencyBinCount is the same as ananlyserNode.fftSize / 2.
const freq2index = require('audio-frequency-to-index')
const sampleRate = audioContext.sampleRate // 44100
const length = analyserNode.frequencyBinCount // 1024
const index = freq2index(400, sampleRate, length)
//=> 19
index = frequencyToIndex(frequency, sampleRate, frequencyBinCount)Converts frequency (in Hz) to an index integer using the audioContext.sampleRate and analyserNode.frequencyBinCount from the Web Audio API.
MIT, see LICENSE.md for details.
FAQs
convert a Hz frequency to an index for WebAudio
The npm package audio-frequency-to-index receives a total of 873 weekly downloads. As such, audio-frequency-to-index popularity was classified as not popular.
We found that audio-frequency-to-index 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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.