🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

audio-visualizer

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

audio-visualizer

Inject audio visualization bars into any html element

1.6.0
unpublished
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Audio Visualizer

Installation

npm install audio-visualizer

Browser visualizer script and d3.min.js is located in the browser folder

Example

var audioElement = document.getElementById('audio');
var parentElement = document.body;
var visualizer = new AudioVisualizer();

// Create Web Audio API references and creates container svg element for visualizer inserted inside parentElement
visualizer.containerHeight = 2500;
visualizer.containerWidth = 2750;
visualizer.create(audioElement, parentElement);

// Refer to Web Audio API analyser for option's reference
visualizer.analyserOptions({
  fftSize: 2048,
  minDecibels: -87,
  maxDecibels: -3,
  smoothingTimeConstant: 0.83
});

// CSS styling for visualizer container
visualizer.containerStyles({
  position: 'absolute',
  top: visualizer.containerHeight * -1,
  left: 0,
  'z-index': 10000,
  'pointer-events': 'none'
});

// Options for visualization bars
// Available colors: purple, blue, green, red, orange, gray
visualizer.options({
  color: 'orange',
  opacity: 0.7,
  interval: 30,
  frequencyDataDivide: 9,
  barPadding: 1.7
});

visualizer.initialize();
visualizer.start();

Chrome Extension Example

https://github.com/zhiwenhuang/audio-equalizer-chrome/blob/master/scripts/content.js

Keywords

audio

FAQs

Package last updated on 24 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts