Socket
Socket
Sign inDemoInstall

audio-visualizer

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    audio-visualizer

Inject audio visualization bars into any html element


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 24 Aug 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc