Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

Latest commit

 

History

History
34 lines (22 loc) · 1.18 KB

readme.md

File metadata and controls

34 lines (22 loc) · 1.18 KB

audio-spectrum unstable Greenkeeper badge

Show spectrum of audio data.

Usage

$ npm install audio-spectrum

let context = require('audio-context')()
let spectrum = require('audio-spectrum')()
let generate = require('audio-generator')(Math.random, {duration: 4})
let write = require('web-audio-write')(context.destination, {channels: 1})

function tick () {
  let buf = generate()
  write(buf, tick)
  spectrum(buf)
}
tick()

API

let showSpectrum = Spectrum(options)

Create spectrum visualizer function with showSpectrum(data) signature. options may include channel to pick the channel to show and every option for gl-spectrum.

Analogs