项目
在 GitHub 查看
foobar404/wave.js
关于
用于 JavaScript 的音频可视化库。创建可随音频文件或音频流变化的动态动画。
设计与媒体实测星标增长
- 24小时
- 0
- 7天
- +2
- 15天
- +2
- 1个月
- +6
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Wave.js
Audio visualizer library for javascript.
Installation
Install With CDN
<script src="https://cdn.jsdelivr.net/gh/foobar404/wave.js/dist/bundle.js"></script>
Or NPM
npm i @foobar404/wave
Setup
If your 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'
Contributing
Get involved! Check out the Contributing Guide for how to get started.
License
探索相关项目
加载中…