Skip to content

Repository files navigation

Wave.js

Audio visualizer library for javascript.

Installation

Install With CDN

<scriptsrc="https://cdn.jsdelivr.net/gh/foobar404/wave.js/dist/bundle.js"></script>

Or NPM

npm i @foobar404/wave

Setup

If your using NPM:

import{Wave}from"@foobar404/wave";

Usage

letaudioElement=document.querySelector("#audioElmId");letcanvasElement=document.querySelector("#canvasElmId");letwave=newWave(audioElement,canvasElement);// Simple example: add an animationwave.addAnimation(newwave.animations.Wave());// Intermediate example: add an animation with optionswave.addAnimation(newwave.animations.Wave({lineWidth: 10,lineColor: "red",count: 20}));// Expert example: add multiple animations with optionswave.addAnimation(newwave.animations.Square({count: 50,diamater: 300}));wave.addAnimation(newwave.animations.Glob({fillColor: {gradient: ["red","blue","green"],rotate: 45},lineWidth: 10,lineColor: "#fff"}));// The animations will start playing when the provided audio element is played// 'wave.animations' is an object with all possible animations on it.// Each animation is a class, so you have to new-up each animation when passed to 'addAnimation'

Contributing

Get involved! Check out the Contributing Guide for how to get started.

License

MIT

About

Audio visualizer library for javascript. Create dynamic animations that react to an audio file or audio stream.

Topics

Resources

Contributing

Stars

733 stars

Watchers

8 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages