👂 An audio analysis tool for real-time and choreographed visualizations.
- Accepts all valid Web Audio nodes
- Accepts multiple nodes at once for complex scenes
- Configurable resolution and frame rate
- Dependency free
- Export/import analyzed data for precise playback
- Added classes for easy loading of audio files
Visit the hosted project page to try it out and to export or import JSON data for use with Equalizer.
npm install --save equalizer.js
import { Equalizer } from 'equalizer.js';
This example creates an audio oscillator and visualizes it with an instance of Equalizer
.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/equalizer.js/build/equalizer.js"></script>
<script>
var playing = false;
var context = new AudioContext(); // From Web Audio API
var equalizer = new Equalizer(context).appendTo(document.body);
// Create audible sound with the Web Audio API
var osc = context.createOscillator();
osc.type = 'square';
osc.frequency.setValueAtTime(440, context.currentTime);
osc.connect(context.destination);
osc.start();
// Add the oscillator to the equalizer
equalizer.add(osc);
equalizer.domElement.addEventListener('click', resume, false);
update();
function resume() {
if (!(/running/.test(context.state))) {
context.resume();
}
}
function update() {
equalizer.update();
requestAnimationFrame(update);
}
</script>
</body>
</html>
A free and open source tool by Jono Brandel