Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

audio-index-to-frequency

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

audio-index-to-frequency

converts an index to Hz frequency for WebAudio

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

audio-index-to-frequency

stable

Convert an index to Hz frequency for WebAudio frequency analysis. Also see audio-frequency-to-index.

const index2freq = require('audio-index-to-frequency')
const sampleRate = audioContext.sampleRate // 44100
const length = analyserNode.frequencyBinCount // 1024

const freq = index2freq(19, sampleRate, length)
//=> 409.130859375

Usage

NPM

frequency = indexToFrequency(index, sampleRate, frequencyBinCount)

Converts the index integer to a frequency (in Hz) with the given audioContext.sampleRate and analyserNode.frequencyBinCount from the WebAudio API.

License

MIT, see LICENSE.md for details.

Keywords

web

FAQs

Package last updated on 25 Nov 2015

Did you know?

Socket

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.

Install

Related posts