audio-index-to-frequency
Convert an index to Hz frequency for WebAudio frequency analysis. Also see audio-frequency-to-index.
const index2freq = const sampleRate = audioContextsampleRate // 44100const length = analyserNodefrequencyBinCount // 1024 const freq = //=> 409.130859375
Usage
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.