How to Create Audio Visualizations with JavaScript | Wave.js

Audio Visualizer Library - wave.js is a vanilla javascript audio visualization library that provides 20+ creative audio visualization effects to bring more engagement to your visitor.

Contribute

  • Fork Wave. js repo.
  • Clone to your local computer.
  • Run ‘npm i‘ in the root folder to install dependencies.
  • Run “npm start” to start the code monitor.
  • Open the src folder and make a change to one of the src files.
  • Push to a remote branch and generate a pull request to the master branch of Wave.js.

Must Read: A Tiny, Minimalistic JS Audio/Music/MP3 Player | microne

How to make use of it:

Install With CDN:

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

Or NPM

npm i @foobar404/wave

If you’re using NPM:

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

Usage

let audioElement = document.querySelector("#audioElmId");
let canvasElement = document.querySelector("#canvasElmId");
let wave = new Wave(audioElement, canvasElement);
// Simple example: add an animation
wave.addAnimation(new wave.animations.Wave());
// Intermediate example: add an animation with options
wave.addAnimation(new wave.animations.Wave({
    lineWidth: 10,
    lineColor: "red",
    count: 20
}));
// Expert example: add multiple animations with options
wave.addAnimation(new wave.animations.Square({
    count: 50,
    diamater: 300
}));
wave.addAnimation(new wave.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'

See Demo And Download

Official Website(foobar404): Click Here

This superior jQuery/javascript plugin is developed by foobar404. For extra advanced usage, please go to the official website.

Related Posts

[Multiple] Replace Select With The Nices Icons | Bootstrap5-Tags

bootstrap5-tags is a Vanilla JavaScript (ES6) extension for Bootstrap 5 that turns a multi-select box into an easy-to-use tag-input component. An original ES6 alternative to choose from…

How to Create the Mega Menu Using HTML and CSS

Mega Menu is a huge, beautifully animated, multi-level dropdown menu component built with nested HTML menus and pure CSS. Must Read: Responsive Mega Menu With Dropdown Menu…

JQuery Multi-Select Plugin Based on Twitter Bootstrap

Bootstrap Multiselect is a JQuery-based plugin to provide an intuitive user interface for using specific inputs with multiple themes. Instead of selecting, the boot button will be…

Versatile Date and Time Picker Calendar for Bulma

Bulma extension for calendar display can be used on a page as a large calendar with appointments or as a date picker/popup window. A responsive, customizable, and…

JQuery Plugin That Fixes Table Headers On Scrolling | jquery.fixedTableHeader

JQuery static table header plugin is a jQuery plugin that fixes table headers on scroll. A super small and fast-fire sticky table header plugin that makes the…

[Checkboxes] Multi-Select with Shift and Ctrl/Cmd Keys | Shift-Select

shiftMultiSelect.js, a jQuery plugin that allows you to convert by clicking multiple checkboxes in table rows to easily select multiple rows at once. It gives a Check…