项目作者: azeem

项目描述 :
Audio Visualization rendering library for the browser
高级语言: TypeScript
项目地址: git://github.com/azeem/webvs.git
创建时间: 2013-05-27T17:35:40Z
项目社区:https://github.com/azeem/webvs

开源协议:MIT License

下载


Webvs

npm version
CircleCI
David
David

A Winamp AVS like visualization library for the web.

Demo

Try out some examples, or test your own presets on the Webvs test page

Documentation

You can find TypeDoc generated documentation for Webvs on the website.
The documentation for the Main class is a good place to start.

Installation

npm

For use with package bundlers, Webvs is available on npm as webvs. Install using

  1. npm install webvs

and import in your code and initialize as follows

  1. import Webvs from 'webvs';
  2. const webvs = new Webvs.Main(....)

CDN

You can also embed webvs.js directly from unpkg CDN.

  1. <script src="https://unpkg.com/webvs/dist/webvs.js"></script>

or for a minified version

  1. <script src="https://unpkg.com/webvs/dist/webvs.min.js"></script>

This script exposes a Webvs global which you can use to initialize like so new Webvs.Main(...).

Usage

A typical usage involves creating an Analyser from your music source (e.g. Webvs.WebAudioAnalyser to use an audio tag or song url as a source) and initializing an instance of Webvs.Main with it. The main object serves as the primary interface or controlling the visualization. e.g.

  1. const analyser = new Webvs.WebAudioAnalyser();
  2. const webvs = new Webvs.Main({
  3. canvas: document.getElementById("canvas"),
  4. analyser: analyser,
  5. showStat: true
  6. });
  7. webvs.loadPreset({
  8. "clearFrame": true,
  9. "components": [
  10. {
  11. "type": "SuperScope",
  12. "source": "WAVEFORM",
  13. "code": {
  14. "perPoint": "x=i*2-1;y=v;"
  15. },
  16. "colors": ["#ffffff"]
  17. }
  18. ]
  19. });
  20. webvs.start();
  21. analyser.load("music.ogg");
  22. analyser.play();

Development

To develop Webvs clone the repo and install packages

  1. npm install

For typical workflow, start a dev server with

  1. npm run dev

and point browser to http://localhost:8080/examples/ to view webvs test page.

Contributing

Fork and submit pull requests against master branch. Look for issues with help wanted label for things that we need help with. For suggestions/bug fixes use Github/Issues. Chat with us at visbot/AVS gitter channel.