0.1.8 • Published 2 years ago

poweraudio v0.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Power Audio

An innovative audio visualization library

Add PowerAudio to your project

Using npm

  1. Add this library into your project
npm i --save poweraudio
  1. Import the PowerAudio object from the lib
// JS ES5
const PowerAudio = require('poweraudio');
// JS ES6/TypeScript
import { PowerAudio } from 'poweraudio';

Using direct web import

  1. Import poweraudio.js in your html
<script src="https://raw.githubusercontent.com/7PH/poweraudio/master/dist/poweraudio.js"></script>
  1. That's it, you now have a global PowerAudio object registered to window

Start a viz

To start a viz, it is as simple as instantiating a new PowerAudio.Viz object. You have to specify the following options:

  • container: Query selector for where to put the visualization
  • source: Audio source element (HTMLAudioElement)
// Create audio element
const audio = new Audio('music.mp3');
// Alternatively: Get audio element from the DOM
//const audio = document.querySelector('audio');

// Start viz in container with id `viz`
const viz = new PowerAudio.Viz({
    container: '#viz',
    source: audio,
});

// Play audio
audio.play();

// Make the PowerCircle (the big circle at the center of the screen) do a backflip
viz.flip();

Examples

Find examples below:

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago