

This a plugin of audio data visualization
- 可视化音频数据
- 自定义渐变色
- 支持两种数据接入方式
check this file: src/index.ts
check this file: test/index.html
- 标签引入
<script src="./dist/AudioVisual.min.js"></script>
- 实例化(file可选)
var av = new AudioVisual(audio, canvas[, config]);
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
audio | 音频节点 | HTMLAudioElement | |
canvas | 画布 | HTMLCanvasElement | |
config | 配置 | object | 参见下面的配置说明 options |
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
isAutoRun | 在音频文件读取完成后立即运行 | boolean | true |
thickness | 粒度 | number | 默认 2048 范围 32~32768,必须是2的n次方 |
colorStops | 渐变色序列 | string[] | 内置默认6种渐变色 |
fileElement | 文件控件,获取音频文件的入口 | HTMLInputElement | 可选 |
- Fork this Repo first
- Clone your Repo
- Install dependencies by
$ npm install
- Checkout a feature branch
- Feel free to add your features
- Make sure your features are fully tested
- Publish your local branch, Open a pull request
- Enjoy hacking <3
Copyright (c) 2018 yangfan2016 <15234408101@163.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
built upon love by docor v0.3.0

Leave a Reply